Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Ask for help about NoScript, no registration needed to post
anbuc

Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by anbuc » Thu Aug 06, 2020 5:55 pm

Firefox 79.0, NoScript 11.0.35, BlockTube 0.3.15

Tested here: https://old.reddit.com/r/videos/

The place where the video should appear remains black. Neither reddit nor youtube are blocked in any capacity
All I get in the console is the following debug message:

Code: Select all

19:43:46.110 sendSyncMessage deferring 
<script src="moz-extension://7673d330…2/src/scripts/inject.js">
SyncMessage.js:250:21
The "inject.js" is this one

It worked with NoScript 11.0.34 and BlockTube was not updated recently, so that's why I first file the issue here. I will create an issue there if it turns out they are at fault, but something had to change in the newest NoScript version that made the issue arise in the first place.
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

User avatar
therube
Ambassador
Posts: 7669
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by therube » Thu Aug 06, 2020 6:50 pm

If you test again with .34 (disable updates, temporarily), do things again work?

https://addons.mozilla.org/en-US/firefo ... /versions/
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 SeaMonkey/2.49.5

anbuc

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by anbuc » Thu Aug 06, 2020 9:32 pm

Yes. With the previous version everything works as expected.

Oh, and I also just noticed that Youtube refuses to execute any scripts altogether in this scenario. These messages appear when I visit the YT homepage

Code: Select all

23:23:45.913 Uncaught ReferenceError: ytcfg is not defined
    <anonymous> https://www.youtube.com/:21
www.youtube.com:21:5

23:23:46.190 Uncaught ReferenceError: ytcsi is not defined
    <anonymous> https://www.youtube.com/yts/jsbin/desktop_polymer_inlined_html_polymer_flags-vflap-46x/desktop_polymer_inlined_html_polymer_flags.js:1
desktop_polymer_inlined_html_polymer_flags.js:1:4

23:23:46.760 Uncaught TypeError: window.chp_ssr is not a function
    <anonymous> https://www.youtube.com/:1137
    <anonymous> https://www.youtube.com/:1147
www.youtube.com:1137:16
    <anonym> https://www.youtube.com/:1137
    <anonym> https://www.youtube.com/:1147
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

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

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by Giorgio Maone » Thu Aug 06, 2020 10:17 pm

Please check latest dev build, thanks:
v 11.0.36rc1
============================================================
x Fixed regression: temporary permissions revocation not
working anymore on privileged pages
x SendSyncMessage script execution safety net more
compatible with other extensions (e.g. BlockTube)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

anbuc

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by anbuc » Fri Aug 07, 2020 3:11 am

Thank you for your quick response!

It works with 11.0.36rc1; most of the time...

Youtube itself is working fine again, the embedded videos sometimes still don't load (~50:50). But I could not figure out what triggers the issue. Reloading the tab does not fix it though. I have to open a new one

If it helps, when it's working, I get only following debug messages in the console

Code: Select all

04:50:09.019 sendSyncMessage allowed 
<script>
SyncMessage.js:271:19

04:50:09.026 BlockTube Init inject.js:811:11
If it is not working, it looks like this

Code: Select all

04:50:00.414 sendSyncMessage deferring 
<script src="moz-extension://7673d330…2/src/scripts/inject.js">
SyncMessage.js:262:21

04:50:00.415 sendSyncMessage blocked 
<script src="moz-extension://7673d330…2/src/scripts/inject.js">
SyncMessage.js:266:21

04:50:00.417 sendSyncMessage running deferred 
<script src="moz-extension://7673d330…2/src/scripts/inject.js">
SyncMessage.js:246:21

04:50:00.424 sendSyncMessage allowed 
<script name="www-roboto">
SyncMessage.js:271:19

04:50:00.425 BlockTube Init inject.js:811:11
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

skriptimaahinen
Senior Member
Posts: 213
Joined: Wed Jan 10, 2018 7:37 am

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by skriptimaahinen » Fri Aug 07, 2020 4:46 am

Did some testing and it seems to be related to the issue at hand.

This here script will sometimes (rarely, maybe 1 out of 20 reloads) produce the "sendSyncMessage deferring", but the deferred script is not executed on .35rc4. On .36rc1 it is executed, but onload listeners do not work.

Code: Select all

// Environment:
//   protocol: http:
//   scripts enabled
//   Deferred script is the one with "console.log("Foo")".

<!DOCTYPE html>
<html>
    <head>
        <link href="temp.css" rel="stylesheet" type="text/css" >
        <script>
                let a = document.createElement('script');
                let m = document.getElementsByTagName('script')[0];
                a.src = 'temp.js';
                m.parentNode.insertBefore(a,m)
        </script>
        <script>
            window.onload = function(event) {
                console.log("onload"); 
            };
            document.addEventListener('DOMContentLoaded', function(event) {  
                console.log("DOMContentLoaded"); 
            });
            console.log("Foo");
        </script>
    </head>
    <body>
    </body>
</html>
3 things in SyncMessage that are noteworthy:

1. The suspend done in beforescriptexecute does not prevent other scripts from running.

2. suspended-variable in suspend() is true for any script that comes after the first, allowing them to bypass the suspend.

3. Deferred scripts do not run (on .35rc4), likely for the same reason as in staticNS.js:113 (though .36rc1 does fix this too).

Using the staticNS fix alone is not enough (for .35rc4). The suspended-check needs to be removed or the beforescriptexecute will go into recursion. .36rc1 does work around this too, but the script execution is postponed too much so that any onload listeners will be late. Although removing the suspended-check seems to work, I do not remember what it was originally there for and if there is still some need for it. But with the current approach, each script needs to be suspended individually. In fact that way there won't be any need for script deferring as we should have the permissions when the suspend is lifted.

However a thing to note with this approach is that since the DOM is not suspended anymore, all event attributes can take effect. Need to check what ramifications that has.
Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0

mrpizzadude
Posts: 2
Joined: Fri Aug 07, 2020 6:39 pm

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by mrpizzadude » Fri Aug 07, 2020 6:52 pm

I tried to post this as a seperate thread, but it got blocked by antispam.

But it seems the issue might be related.

Hi. I reported this issue in late October 2019 and it was fixed then but it seems the issue has cropped up again.

https://github.com/hackademix/noscript/issues/108

Violentmonkey userscripts such as the ones listed in that GitHub issue only work 50% of the time. (Half the time they don't execute) This started happening with NoScript 11.0.36.

It should be worth noting that the previous version of NoScript, 11.0.35, prevented YouTube to load, but that was fixed in 11.0.36. It might of been due to having another YouTube extension used in conjunction with NoScript. However, the violentmonkey script issue still stands.

Also, please ignore my user agent. It is faked.
Last edited by barbaz on Sat Aug 08, 2020 12:16 am, edited 1 time in total.
Reason: unbreak link
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

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

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by Giorgio Maone » Sat Aug 08, 2020 7:38 am

Please check latest RC version, thanks (especially to skriptimaahinen for the insight):

v 11.0.37rc1
============================================================
x Updated TLDs
x sendSyncMessage support for multiple suspension requests
(should fix extension script injection issues)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

anbuc

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by anbuc » Sat Aug 08, 2020 9:51 pm

Seems fixed. I could no longer reproduce the issue.

Thanks you
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

mrpizzadude
Posts: 2
Joined: Fri Aug 07, 2020 6:39 pm

Re: Youtube embeds do not work since NoScript 11.0.35, in conjunction with BlockTube

Post by mrpizzadude » Sun Aug 09, 2020 3:59 am

Confirmed fixed. Thanks :)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36

Post Reply