Firefox extension – retrieve href from class |works| – opening new window or start to download from given url – not working

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 the manifest.json


"manifest_version": 2,
"name": "Adskipper",
"version": "0.97",

"description": "Skip the Countdown and download instantly",
"permissions": ["downloads.open", "downloads", "webRequest", "tabs"],

"icons": {
    "48": "icons/adskip_48.png",
    "96": "icons/adskip_96.png"
  },

"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 onCreated(tab) {
  console.log(`Created new tab: ${tab.id}`)
}

function onError(error) {
  console.log(`Error: ${error}`);
}

browser.browserAction.onClicked.addListener(function() {
  var creating = browser.tabs.create({
    url:"https://www.duckduckgo.com"
  });
  creating.then(onCreated, onError);
});

onCreated();

*/

/* browser.downloads.download({url: "https://ir.ebaystatic.com/rs/v/fxxj3ttftm5ltcqnto1o4baovyl.png"});
*/

*/ These are the approaches I tried at the end. I’ve tried different approaches but still had no luck to open the url from the var arringo
*/

Comments:
border.js is just loaded to see if the extension works

jquery has been added since I tried a jquery approach on it. If possible I don’t want to include it.

I added the permissions in the manifest.json but I’m not sure whether I need them / another ones / or not at all.

Please don’t downvote my question again. I tried everything to comply with the stackoverflow guidelines.