Hello, i’m new here. I want to develop a firefox extension for my site.
I started to create files, it’s all ok.But for now, i want to work step by step.I tried to add a alert when page loaded
function startup(){
var x = "done !";
alert(x);
}
window.addEventListener("load", startup, false);
I want learn to develop extension, final step is extract from a player loaded in iframe, url of video link directly (video.mp4), for now is little hard.
I think what you want is to wait for the document to be loaded using: document.addEventListener('DOMContentLoaded', () => {/* your code here */}).
But for your ultimate goal - extracting link from iframe - you cannot use content script running in the parent document (you cannot access iframe due to security restrictions).
You will need to either inject your content script into that iframe (or all frames), or intercept the webRequest: