Page 1 of 1

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

Posted: Thu Aug 06, 2020 5:55 pm
by anbuc
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.

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

Posted: Thu Aug 06, 2020 6:50 pm
by therube
If you test again with .34 (disable updates, temporarily), do things again work?

https://addons.mozilla.org/en-US/firefo ... /versions/

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

Posted: Thu Aug 06, 2020 9:32 pm
by anbuc
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

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

Posted: Thu Aug 06, 2020 10:17 pm
by Giorgio Maone
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)

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

Posted: Fri Aug 07, 2020 3:11 am
by anbuc
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

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

Posted: Fri Aug 07, 2020 4:46 am
by skriptimaahinen
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.

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

Posted: Fri Aug 07, 2020 6:52 pm
by mrpizzadude
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.

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

Posted: Sat Aug 08, 2020 7:38 am
by Giorgio Maone
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)

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

Posted: Sat Aug 08, 2020 9:51 pm
by anbuc
Seems fixed. I could no longer reproduce the issue.

Thanks you

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

Posted: Sun Aug 09, 2020 3:59 am
by mrpizzadude
Confirmed fixed. Thanks :)