greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.43k stars 431 forks source link

Working userscript fails to sync #1111

Closed adamlui closed 1 year ago

adamlui commented 1 year ago

My script https://github.com/adamlui/userscripts/blob/master/hide-forum-images.user.js fails to sync w/ https://greasyfork.org/en/scripts/12639-hide-forum-images.

The code is:

// ==UserScript==
// @name             Hide Forum Images
// @version          2023.01.15.1
// @author           Adam Lui
// @namespace        https://elonsucks.org/@adam
// @description      Hides images/videos from XenForo and vBulletin forums.
// @supportURL       https://github.com/adamlui/userscripts/issues
// @license          MIT
// @compatible       chrome
// @compatible       firefox
// @compatible       opera
// @compatible       safari
// @compatible       edge
// @match            http*://*/*
// @grant            GM_addStyle
// @updateURL        https://greasyfork.org/en/scripts/12639/code/youtube-classic.meta.js
// @downloadURL      https://greasyfork.org/en/scripts/12639/code/youtube-classic.user.js
// ==/UserScript==

if (document.querySelector('[src*="vbulletin"]') || document.querySelector('a[href*="xenforo"]')) {
    GM_addStyle('img, [style*="background-image"], [class*="avatar"], [class*="player"] { display:none !important; }');
}

The error is:

image

The script works in all @compatible tested browsers. Anyone know why? Thanks!

adamlui commented 1 year ago

It is also happening between https://greasyfork.org/en/scripts/458346-hide-mturk-alerts and https://github.com/adamlui/userscripts/blob/master/mturk/hide-mturk-alerts.user.js

JasonBarnabe commented 1 year ago

Are you actually using the URL https://github.com/adamlui/userscripts/blob/master/hide-forum-images.user.js ? You need to use something that serves up raw JS, like the "Raw" link on GitHub: https://github.com/adamlui/userscripts/raw/master/hide-forum-images.user.js

adamlui commented 1 year ago

Thanks for the help, it works now!

adamlui commented 1 year ago

As a suggestion, your competitor openuserjs.org doesn't require you to select thee raw code so changing instruction from "provide a URL" to "provide a raw URL" may be more intuitive (or outright allow using the blob url)

adamlui commented 1 year ago

Also on a related note, when deleting scripts I seek to redirect users to replacement, do I enter the URL for the raw script or the general page in "Enter the replacement script's URL"?

JasonBarnabe commented 1 year ago

That feature requires a URL on Greasy Fork. It can handle either the raw URL or the HTML version.

adamlui commented 1 year ago

I see, so you can copy the logic to github sync and more people would use it (e.g. those who never noticed failure message) leading to more up-to-date code thus users so ad clicks rise

JasonBarnabe commented 1 year ago

Added some logic to handle GitHub HTML view URLs, thanks for the suggestion.