Benjol / SE-AutoReviewComments

AutoReviewComments - Pro-forma comments for SE
http://stackapps.com/q/2116
98 stars 39 forks source link

Stackexchange.ready is not a function #145

Open surajrao opened 6 years ago

surajrao commented 6 years ago

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 commented 6 years ago

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

oliversalzburg commented 6 years ago

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

surajrao commented 6 years ago

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 ?

oliversalzburg commented 6 years ago

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

oliversalzburg commented 6 years ago

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

oliversalzburg commented 6 years ago

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.