NoScript interferes with jQuery on trusted host

Bug reports and enhancement requests
Post Reply
happy_ant
Posts: 3
Joined: Wed Jan 22, 2020 1:18 pm

NoScript interferes with jQuery on trusted host

Post by happy_ant » Wed Jan 22, 2020 2:10 pm

NoScript 11.0.12
Firefox 72.0.1 (64-bit)
Trusted host: localhost (development server)

Problem: jQuery is sometimes not working. One time I can reload the page and it works again, the other time I doesn't, sometimes it takes 10 to 20 reloads until the error shows up again.

Console output:

Code: Select all

ReferenceError: jQuery is not defined jquery-ui.min.js:6:52
    jQuery 2
        <anonymous>
        <anonymous>
    suspend moz-extension://2ff8219d-2bc1-446f-a8c7-5a4017338393/lib/SyncMessage.js:214
The message above appears on pages where jQuery and jQueryUI are only loaded, but no scripts executed. On pages with script content I get an additional message:

Code: Select all

ReferenceError: $ is not defined page.php:735:1
    <anonymous> http://localhost/page.php:735
    suspend moz-extension://2ff8219d-2bc1-446f-a8c7-5a4017338393/lib/SyncMessage.js:214
I tried to remove localhost from trusted hosts and added it again, but the problem is still there.


Have a nice day!

Edit: All jQuery libraries are located on localhost, nothing is loaded from external hosts.
Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

User avatar
Giorgio Maone
Site Admin
Posts: 8771
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript interferes with jQuery on trusted host

Post by Giorgio Maone » Wed Jan 22, 2020 2:48 pm

Could you please send me the sources of both the page and the imported scripts of the first case, and of the html rendered in the browser in the second case (in order to examine the code around line 735)? Thanks.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

happy_ant
Posts: 3
Joined: Wed Jan 22, 2020 1:18 pm

Re: NoScript interferes with jQuery on trusted host

Post by happy_ant » Wed Jan 22, 2020 4:25 pm

Just tested with a nearly empty page where only the libraries and stylesheets are loaded and a simple jQuery script should be executed, same problem.

Source of page:

Code: Select all

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="format-detection" content="telephone=no">
<title>Test</title>
<script src="./jquery-3.4.1.min.js"></script>
<script src="./jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery-ui.css">
<link rel="stylesheet" type="text/css" href="main.css">
<script>
$(function() {
    $("#pTest").append('<p>...works!</p>');
});
</script>
</head>
<body>
<p id="pTest">Test...</p>
</body>
</html>
Console output after some reloads:

Code: Select all

ReferenceError: jQuery is not defined jquery-ui.min.js:6:52
    jQuery 2
        <anonymous>
        <anonymous>
    suspend moz-extension://2ff8219d-2bc1-446f-a8c7-5a4017338393/lib/SyncMessage.js:214

ReferenceError: $ is not defined empty.php:13:1
    <anonymous> http://localhost/empty.php:13
    suspend moz-extension://2ff8219d-2bc1-446f-a8c7-5a4017338393/lib/SyncMessage.js:214
Loaded libraries are unmodified official versions:
https://code.jquery.com/jquery-3.4.1.min.js
https://jqueryui.com/resources/download ... 1.12.1.zip

You don't have to waste time with the second case because that's only the result of the first case. "$ is not defined" means that something went wrong with jQuery library when the page was loaded.

I'm not sure, but I think it may have something to do with tabs. When I reloaded my test page in a new tab, I had no problems even after about 50 reloads. When I copied the URI to another tab where I had those problems before, it only took four reloads until it stopped working. I'll keep an eye on that...
Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

happy_ant
Posts: 3
Joined: Wed Jan 22, 2020 1:18 pm

Re: NoScript interferes with jQuery on trusted host

Post by happy_ant » Sat Jan 25, 2020 3:41 pm

A quick update on this issue, using FF 72.0.2 now:

Coding and testing for 90 minutes without problems, then my JS stops working and console shows the same error messages again. Reloaded the page some times, about 1 out of 20 reloads showed errors.

Closed all other tabs, reloaded some more times, still showing errors every now and then.

Opened my test site in a new tab and got no errors after reloading about 50 times.
Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

Post Reply