Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts don't execute on streamtape.com #2171

Open
j4k0xb opened this issue Sep 8, 2024 · 11 comments
Open

Scripts don't execute on streamtape.com #2171

j4k0xb opened this issue Sep 8, 2024 · 11 comments

Comments

@j4k0xb
Copy link

j4k0xb commented Sep 8, 2024

Expected Behavior

Execute the userscript.

Actual Behavior

Script isn't executed.
This only happens for this site on brave (works on firefox).
Same behavior with Tampermonkey beta.

page logs:

Navigated to https://streamtape.com/
content.js:63 content: normal start event processing for m0t2te3z.1d (1 to run)
content.js:56 env: schedule "New Userscript" for document-idle
content.js:54 env: inject "New Userscript" now
popper.min.js:4 Uncaught SyntaxError: Unexpected token 'export' (at popper.min.js:4:19713)
content.js:62 content: DOMContentLoaded
(index):292 
        
        
       GET https://mc.yandex.ru/metrika/tag.js net::ERR_BLOCKED_BY_CLIENT
(anonymous) @ (index):292
(anonymous) @ (index):292
content.js:55 env: run "New Userscript" now  (0 requires)
content.js:62 content: load

background.js logs:

mh: request  {method: 'contextmenu', url: 'https://streamtape.com/', id: 'm0t1fwoh.by'}  sender:  {id: 'dhdgffkkebhmkfjojejmpbldmpobfkfo', url: 'https://streamtape.com/', origin: 'https://streamtape.com', frameId: 0, documentId: '3B244D7883DB738B75713FCDD05FE60D', …}
background.js:744 mh: request page: undefined extpage: false
background.js:902 scriptman: determineScriptsToRun @https://streamtape.com/
background.js:1006 scriptman: @include "/^[hH][tT][tT][pP][sS]:\/\/[sS][tT][rR][eE][aA][mM][tT][aA][pP][eE]\.[cC][oO][mM](:[0-9]{1,5})?\/$/" matched (00518c35-c20a-4c7e-9484-f5a2648da1c1)
background.js:904 scriptman: determineScriptsToRun: found script  {script: {…}, cond: {…}}
background.js:786 check New Userscript for enabled:true
background.js:902 scriptman: determineScriptsToRun @https://streamtape.com/
background.js:1006 scriptman: @include "/^[hH][tT][tT][pP][sS]:\/\/[sS][tT][rR][eE][aA][mM][tT][aA][pP][eE]\.[cC][oO][mM](:[0-9]{1,5})?\/$/" matched (00518c35-c20a-4c7e-9484-f5a2648da1c1)
background.js:904 scriptman: determineScriptsToRun: found script  {script: {…}, cond: {…}}
background.js:786 check New Userscript for enabled:true
background.js:821 badge: set icon 
background.js:822 badge: set 
background.js:743 mh: request  {method: 'prepare', id: 'm0t2te3z.1d', topframe: true, url: 'https://streamtape.com/'}  sender:  {id: 'dhdgffkkebhmkfjojejmpbldmpobfkfo', url: 'https://streamtape.com/', origin: 'https://streamtape.com', frameId: 0, documentId: '49465E43944741742683B522990DBD1E', …}
background.js:744 mh: request page: undefined extpage: false
background.js:818 run script New Userscript @ https://streamtape.com/
background.js:821 badge: set icon 
background.js:822 badge: set 1
background.js:821 badge: set icon 
background.js:822 badge: set 1

Specifications

  • Brave: 1.69.162 (Chromium: 128.0.6613.120)
  • TM: 5.2.3
  • OS: Manjaro Linux

Script

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://streamtape.com/
// @icon         https://icons.duckduckgo.com/ip2/streamtape.com.ico
// @grant        none
// ==/UserScript==

console.log(location.origin);
@F9y4ng
Copy link

F9y4ng commented Sep 11, 2024

Turning off Brave Shields or any other adblocker can bring it back to normal, it should be a problem caused by site scripts conflicting with TM and adblocker.

@j4k0xb
Copy link
Author

j4k0xb commented Sep 11, 2024

That's unfortunate... This site is infested with ads
Gonna look what filter in https://github.com/uBlockOrigin/uAssets causes it

@j4k0xb j4k0xb closed this as completed Sep 11, 2024
@derjanb
Copy link
Member

derjanb commented Sep 11, 2024

You can also try to set Content Script API to UserScripts API Dynamic. By doing so the script might run earlier than uBO's injected filter snippets.

@F9y4ng
Copy link

F9y4ng commented Sep 12, 2024

That's unfortunate... This site is infested with ads Gonna look in what filter in https://github.com/uBlockOrigin/uAssets causes it

@j4k0xb It could be a script conflict, not related to filtering rules. And the console didn't get any useful information.

You can also try to set Content Script API to UserScripts API Dynamic. By doing so the script might run earlier than uBO's injected filter snippets.

@derjanb The UserScripts API Dynamic mode doesn't help.

BTW. TM 5.3.6209 BETA does not resolve issue #2164, Whenever the browser is updated, GM_info.userAgentData returns still the original version number in UserScripts API Dynamic mode.

@j4k0xb j4k0xb reopened this Sep 22, 2024
@j4k0xb
Copy link
Author

j4k0xb commented Sep 22, 2024

The same script works in Violentmonkey btw, so I think it's a Tampermonkey issue

@F9y4ng
Copy link

F9y4ng commented Sep 23, 2024

The same script works in Violentmonkey btw, so I think it's a Tampermonkey issue

Violentmonkey also has problems. You can try running the following script. The window.atob method will report an error. @j4k0xb @tophf

Script

// ==UserScript==
// @name        New script
// @namespace   Violentmonkey Scripts
// @match       https://streamtape.com/*
// @grant       unsafeWindow
// @version     1.0
// @author      -
// @description test
// @run-at      document-start
// ==/UserScript==

console.group("unsafeWindow")
console.log(unsafeWindow.atob);
console.log(unsafeWindow.atob("QQ=="))
console.groupEnd("unsafeWindow")

console.group("window")
console.log(window.atob);
console.log(window.atob("QQ=="))
console.groupEnd("window")

@j4k0xb
Copy link
Author

j4k0xb commented Sep 23, 2024

The window.atob method will report an error.

nope it works fine
image

@F9y4ng
Copy link

F9y4ng commented Sep 23, 2024

The window.atob method will report an error.

nope it works fine
image

with uBlock Origin?

@F9y4ng
Copy link

F9y4ng commented Sep 24, 2024

voilentmonkey with uBO:
screenshot_2024-09-24_12-24-29

@tophf
Copy link

tophf commented Sep 24, 2024

  1. The order in which extensions run at document_start probably depends on which extension was installed first. If uBO runs first it mangles atob somehow. I'd say it's a bug in uBO filters, because breaking such basic functions is overly destructive.
  2. Since Violentmonkey is still MV2, a real document_start requires you to enable "Synchronous page mode" option.

@F9y4ng
Copy link

F9y4ng commented Sep 24, 2024

  1. The order in which extensions run at document_start probably depends on which extension was installed first. If uBO runs first it mangles atob somehow. I'd say it's a bug in uBO filters, because breaking such basic functions is overly destructive.
  2. Since Violentmonkey is still MV2, a real document_start requires you to enable "Synchronous page mode" option.

Hi @tophf , I already enabled "Synchronous page mode" option, but it did not work.

And I fixed it by GM_addElement to get window.atob, and thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants