soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Currently isn't functional on Violentmonkey; gear (settings) button and diamond button (meta notifications) in the topbar are missing #500

Closed AmperAndSand closed 2 years ago

AmperAndSand commented 2 years ago

Describe the bug For the past few days, SOX (dev version) doesn't seem to be functional. Adding the title of the question in the 'Share' link doesn't work. The gear (settings) button and diamond button (meta notifications) in the topbar are missing.

To Reproduce Steps to reproduce the behaviour:

  1. Go to any SE site.
  2. Notice that the gear (settings) button is now missing and that none of SOX' functionality works.

SOX errors logged in console Note: Both console logs below are from an incognito/private window where only the Violentmonkey extension is enabled and only SOX is the script that is enabled. The test page: https://movies.stackexchange.com/questions/118616/how-did-maester-mellos-know-to-bring-moon-tea-to-princess-rhaenyra

Brave:

gpt.js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
analytics.js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
movies.stackexchange.com/:1 Uncaught (in promise) SyntaxError: Unexpected token 's', "sox.common.info.json" is not valid JSON
    at JSON.parse (<anonymous>)
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:251:27
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:879:3
    at window.VMincre66i9sl6akott1 (chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:4136:7)
    at i (injected-web.js:1:16514)
    at Rt (injected-web.js:1:16629)
    at set (injected-web.js:1:16367)
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:1:28
DevTools failed to load source map: Could not load content for chrome-extension://jinjaccalgkegednnccohejagnlnfdag/jquery.timeago.min.js.map: System error: net::ERR_BLOCKED_BY_CLIENT

Firefox:

Some cookies are misusing the recommended “SameSite“ attribute 2
Google Publisher Tags is being shimmed by Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=1713685 for details. sandbox eval code:1:9
Google Analytics and Tag Manager is being shimmed by Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=1713687 for details. sandbox eval code:1:9
The resource at “https://www.google-analytics.com/g/collect?v=2&tid=G-S812YQPLT2&gtm=2oe9j0&_p=761709864&gcs=G111&cid=1739407997.1663673013&ul=en-us&sr=1366x768&_z=ccd.v9B&_s=1&sid=1663673012&sct=1&seg=0&dl=https%3A%2F%2Fmovies.stackexchange.com%2Fquestions%2F118616%2Fhow-did-maester-mellos-know-to-bring-moon-tea-to-princess-rhaenyra&dr=https%3A%2F%2Fmovies.stackexchange.com%2Fusers%2Flogin%3Fssrc%3Dhead%26returnurl%3Dhttps%253a%252f%252fmovies.stackexchange.com%252fquestions%252f118616%252fhow-did-maester-mellos-know-to-bring-moon-tea-to-princess-rhaenyra&dt=plot%20explanation%20-%20How%20did%20Maester%20Mellos%20know%20to%20bring%20%22Moon%20Tea%22%20to%20Princess%20Rhaenyra%3F%20-%20Movies%20%26%20TV%20Stack%20Exchange&en=page_view&_fv=1&_nsi=1&_ss=1&_ee=1&ep.routename=Questions%2FShow&ep.tags=%7Cplot-explanation%7Chouse-of-the-dragon%7C&ep.ads_blocked=false” was blocked because content blocking is enabled. how-did-maester-mellos-know-to-bring-moon-tea-to-princess-rhaenyra

Expected behaviour That SOX work. At the least, the gear (settings) button should appear in the topbar.

Environment SOX version: 2.8.3 DEV Platform: Brave & Violentmonkey, and Firefox & Violentmonkey Note: The auto-populate version functionality didn't seem to work.

shu8 commented 2 years ago

Hi, thanks for the bug report!

I can't reproduce this in Chrome/FF with Tampermonkey, but could you try removing line 42 (// @resource common sox.common.info.json) from the main userscript file within Violetmonkey, save, and refresh an SE page?

Does that fix the problem and/or show different messages in the Console?

AmperAndSand commented 2 years ago

@shu8 I tried removing the line in Violentmonkey in both Brave and Firefox, but the issue persists in both browsers.

Brave console log:

(index):4330          GET https://securepubads.g.doubleclick.net/tag/js/gpt.js net::ERR_BLOCKED_BY_CLIENT
l @ (index):4330
(anonymous) @ (index):4330
(anonymous) @ (index):4330
n.push @ (index):4330
(anonymous) @ (index):4358
movies.stackexchange.com/:4462          GET https://www.googletagmanager.com/gtag/js?id=G-S812YQPLT2 net::ERR_BLOCKED_BY_CLIENT
(index):4470          GET https://www.google-analytics.com/analytics.js net::ERR_BLOCKED_BY_CLIENT
(anonymous) @ (index):4470
(anonymous) @ (index):4471
DevTools failed to load source map: Could not load content for chrome-extension://jinjaccalgkegednnccohejagnlnfdag/jquery.timeago.min.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
VM135:1 Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:251:27
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:879:3
    at window.VMinkf12osy3cxfnefr0 (chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:4135:7)
    at i (injected-web.js:1:16514)
    at Rt (injected-web.js:1:16629)
    at set (injected-web.js:1:16367)
    at chrome-extension://jinjaccalgkegednnccohejagnlnfdag/Stack%20Overflow%20Extras%20(/SOX).user.js#1:1:28
(anonymous) @ Stack Overflow Extras (SOX).user.js:251
(anonymous) @ Stack Overflow Extras (SOX).user.js:879
window.VMinkf12osy3cxfnefr0 @ Stack Overflow Extras (SOX).user.js:4135
i @ injected-web.js:1
Rt @ injected-web.js:1
set @ injected-web.js:1
(anonymous) @ Stack Overflow Extras (SOX).user.js:1
await in (anonymous) (async)
ft @ injected.js:1
ut @ injected.js:1
(anonymous) @ injected.js:1
await in (anonymous) (async)
(anonymous) @ injected.js:1
Ce @ injected.js:1
dt @ injected.js:1
qt @ injected.js:1
await in qt (async)
(anonymous) @ injected.js:1
n @ injected.js:1
(anonymous) @ injected.js:1
(anonymous) @ injected.js:1

Firefox console log:

The resource at “<URL>” was blocked because content blocking is enabled. 2
Some cookies are misusing the recommended “SameSite“ attribute 2
Google Publisher Tags is being shimmed by Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=1713685 for details. sandbox eval code:1:9
Google Analytics and Tag Manager is being shimmed by Firefox. See https://bugzilla.mozilla.org/show_bug.cgi?id=1713687 for details. sandbox eval code:1:9
Source map error: Error: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://fd2eb12b-8102-4117-a7f4-b3508c3e00bb/%20Stack%20Overflow%20Extras%20(SOX).user.js#1
Source Map URL: jquery.timeago.min.js.map
shu8 commented 2 years ago

Thanks for checking! I installed Violetmonkey and can reproduce this now.

It's weird that it's only started happening in the last few days -- it's possible that a recent Violetmonkey update broke this somehow.

Would you be able to check if SOX works with Tampermonkey? If so, we may need to dig deeper into what's changed in Violetmonkey recently.

AmperAndSand commented 2 years ago

@shu8 I just tested and it works fine with Tampermonkey. The issue seems to indeed be related to a recent Violentmonkey update.

shu8 commented 2 years ago

Thanks for confirming that! Could you check if the latest Violetmonkey Beta fixes this for you? https://github.com/violentmonkey/violentmonkey/releases.

I saw that there was a recent change to the get resource logic: https://github.com/violentmonkey/violentmonkey/commit/83bd2497f5ce37286e4383a20954ab083686e2c4#diff-48d1dbb32ce280539c8dec96362dd75f28799c6d3e632ddcfc34294110aed291 which might fix it

AmperAndSand commented 2 years ago

@shu8 It still doesn't work with the current latest Violentmonkey beta, v2.13.1.2.

shu8 commented 2 years ago

I've posted a bug report on Violentmonkey: https://github.com/violentmonkey/violentmonkey/issues/1589.

I'm going to close this issue though as it doesn't seem specific to SOX -- thanks for raising it though!

shu8 commented 2 years ago

(looks like it's been fixed, the next beta version should work!)