Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.24k stars 419 forks source link

Tampermonkey print error "TypeError: Cannot read property 'bind' of undefined" on repl.it #1052

Closed XCanG closed 3 years ago

XCanG commented 4 years ago

On this page https://repl.it/talk/share/Patatap-Clone/55084 there is HTML console, which print any console output and Tampermonkey throwing error and printed in this console:

Tampermonkey sandbox preparation (internal.c_d) failed. This usually is caused by a third-party extension. TypeError: Cannot read property 'bind' of undefined
    at Object.c_d (<anonymous>:5:499)
    at <anonymous>:8:216
    at Array.forEach (<anonymous>)
    at <anonymous>:8:182
    at <anonymous>:10:152
    at <anonymous>:13:47

Well this issue need to be fixed and not print in this console.

Expected Behavior

No error.

Actual Behavior

Throwing error and printed in console, where it shouldn't be.

Specifications

derjanb commented 4 years ago

Please re-try with a new temporary profile. Do you still see the error?

-> https://www.chromium.org/developers/creating-and-using-profiles

XCanG commented 4 years ago

Ok, so:

  1. I create fresh new profile
  2. Install Tampermonkey
  3. Import userscript, which work for me on all pages
  4. Go to https://repl.it/talk/share/Patatap-Clone/55084
  5. Start repl
  6. See same error

Additionally I check and disable my global userscript and still see this error. Important note, that I see it when I click start button ▶️

raszpl commented 3 years ago

uBo installed and running? usually this ends up being one of uBo scriptlets loading first and stubbing global js functions out

XCanG commented 3 years ago

@raszpl uBlockOrigin is used as well, yes. However it wasn't used on clear profile. I install only Tampermonkey there. So it confirm that Tampermonkey have problem on it's own and it have nothing to do with uBlockOrigin.

raszpl commented 3 years ago

cant reproduce, also looked into most common ubo lists and this site is not in them so that wouldnt be it

XCanG commented 3 years ago

@raszpl do you have any global script, that work everywhere in Tampermonkey? If not, try open with it.

raszpl commented 3 years ago

Important note, that I see it when I click start button ▶️

wait, I didnt even see play button on my normal install (captchas, blocked scripts etc). so this is a part of https://getsentry.github.io/sentry-javascript/index.html wank of the week framework on top of frameworks? whatever tf Breadcrumbs is https://getsentry.github.io/sentry-javascript/classes/browser.breadcrumbs.html it is patching various functions including console for instrumentation purposes. No idea how it is doing it before tampermonkey page.js is injected.

derjanb commented 3 years ago

Important note, that I see it when I click start button arrow_forward

wait, I didnt even see play button on my normal install (captchas, blocked scripts etc).

That was the "missing" hint... 😅 Thanks for poining it out (again). I can reproduce the problem. Will be fixed at the next beta release.

raszpl commented 3 years ago
webpack:///./src/shared/console.js

what in the world is that thing? :0 how does it work? I have most of the stupid shi^functions blocked in my daily driver browser, so wasnt seeing any of it.

derjanb commented 3 years ago
webpack:///./src/shared/console.js

what in the world is that thing? :0 how does it work? I have most of the stupid shi^functions blocked in my daily driver browser, so wasnt seeing any of it.

They have a source map link somewhere, that's why the debugger tools show an imaginary orginal file.

NullDev commented 3 years ago

I'm getting the very same problem on repl.it:

Tampermonkey sandbox preparation (internal.c_d) failed. This usually is caused by a third-party extension. TypeError: Cannot read property 'bind' of undefined
    at Object.c_d (<anonymous>:5:499)
    at <anonymous>:8:216
    at Array.forEach (<anonymous>)
    at <anonymous>:8:182
    at <anonymous>:10:152
    at <anonymous>:13:47

image

Also, this is line 64 of breadcrumbs.js:

// this fails for some browsers. :(
if (originalConsoleLevel) {
    Function.prototype.apply.call(originalConsoleLevel, global.console, args);
}
UnevenCoder commented 3 years ago

Error coming again , what to do ?