I wrote an extension that should get the content of a specific href link. It should then open the url without user interaction.
The script I've been working on so far gets the correct url. It can print the url in a push notification. The basics of the FF extension work.
But no matter what I've tried (open.window, browser.downloads., window.location) never has a window opened or the download started when visting the domain / website containing the hidden--Element.
I'm a total beginner but I would like to get this script to work. This would motivate me to keep on learning.
This is from the manifest.json
"permissions": ["downloads.open", "downloads", "webRequest", "tabs"],
"content_scripts": [
{
"matches": ["*://*.thedomain.org/*"],
"js": ["border.js", "jquery-3.6.0.min.js", "adskip.js"],
"run_at": "document_end"
this is the content of adskip.js
for(var i=0; i<l.length; i++) {
arringo.push(l[i].href);
}
alert(arringo);
function redirect() {
location.href = arringo;
}
addEventListener('load', redirect);
I added the permissions in the manifest.json but I'm not sure whether I need them / another ones / or not at all.