SE-AutoReviewComments icon indicating copy to clipboard operation
SE-AutoReviewComments copied to clipboard

Stackexchange.ready is not a function

Open surajrao opened this issue 7 years ago • 6 comments

Go to https://stackexchange.com

Following error in the console:

Uncaught TypeError: StackExchange.ready is not a function
    at <anonymous>:2:17
    at <anonymous>:890:3
    at with_jquery (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:32)
    at Window.eval (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:35)
    at <anonymous>:2:120
    at eval (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:2)
    at eval (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:3)
    at Object.eval (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:926)
    at eval (chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/userscript.html?id=3398c345-6822-4d11-acf2-55d09dbbbd2a:928)
    at eval (<anonymous>)

Stackexchange.ready is not a function

Regex probably needs a tweak:

// @include /^https?:\/\/(.*\.)?stackexchange\.com/.*$/ to disable in the main site as I do not see a use case there

surajrao avatar Jan 13 '18 12:01 surajrao

Workaround is change the include to // @include /^https?:\/\/(.*\.)stackexchange\.com/.*$/

surajrao avatar Feb 09 '18 06:02 surajrao

@surajrao Would you suggest we add that to the script? Do you want to create a pull request maybe?

oliversalzburg avatar Mar 15 '18 08:03 oliversalzburg

Its working without a glitch for me.. I could do a pull request. But do I need to just make changes in dist / folder or the build xml file ?

surajrao avatar Mar 15 '18 12:03 surajrao

Heh, good point. I forgot about how these URLs are generated. Probably a bit more complicated than I hoped.

oliversalzburg avatar Mar 15 '18 12:03 oliversalzburg

This is also related to #133 and #138 as the latter only fixed the dist files.

oliversalzburg avatar Mar 15 '18 21:03 oliversalzburg

The userscript already uses // @include /^https?:\/\/(.*\.)?stackexchange\.com/.*$/. So that can't be the fix :D

I guess it would need to be // @include /^https?:\/\/(.*\.)stackexchange\.com/.*$/ (? removed). But that require a lot of changes in the build system.

How about we just add // @exclude *://stackexchange.com/*? This seems to resolve it for me.

oliversalzburg avatar Mar 15 '18 21:03 oliversalzburg