Unable to run java code within addon window

When I view the the html page containing the script in firefox the code loads and exacutes correctly but when I open the webpage via the debug add on and load the page as an addon the script no longer functions, is there a reason this is happening?

Any advice greatful appreciated.

I would like to share my code how do I post it ?

Make sure you put your js in a .js file that you load with a <script src="scriptfile.js"></script> tag. Inline scripts are not allowed in extensions, so onload etc. properties in HTML will also not work.

Thanks Martin

Just tested with an example from w3schools, while it works when I view the html page natively with in firefox it works if I load it as an app it does not (https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto_external)

I copied the external script file as detailed on this page (https://www.w3schools.com/js/js_whereto.asp)
“function myFunction() {
document.getElementById(“demo”).innerHTML = “Paragraph changed.”;
}”

Many thanks Tom

onclick in HTML is not allowed, you should use addEventListener (see also https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events) in your script instead.