Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks disq.us redirect. #1

Closed
Ghost-BD opened this issue Feb 4, 2022 · 5 comments
Closed

Breaks disq.us redirect. #1

Ghost-BD opened this issue Feb 4, 2022 · 5 comments

Comments

@Ghost-BD
Copy link

Ghost-BD commented Feb 4, 2022

Redirect to any other site from disq.us link with this script is not working. Like "https://disq.us/url?url=https://media3.giphy.com/media/l0MYEqEzwMWFCg8rm/giphy.gif:REiNKA71iAPDZrexrL63wFxLIS8&cuid=870217" this link changes to this "https://media3.giphy.com/media/l0MYEqEzwMWFCg8rm/giphy.gif:REiNKA71iAPDZrexrL63wFxLIS8". Extra portion (:REiNKA71iAPDZrexrL63wFxLIS8) at the end of link breaks it. You can check this at any website with disqus.com comment section like "https://wccftech.com/amd-reaffirms-radeon-rx-7000-rdna-3-gpu-ryzen-7000-zen-4-cpu-launch-in-2022-spending-big-money-to-secure-increased-capacity/" where clicking any gif or link other than disq.us doesn't work as expected.

This is a useful script but unfortunately, doesn't work with FireMonkey. Can you make this FireMonkey compatible please? That is a good user script manager.

@dividedby
Copy link
Owner

Redirect to any other site from disq.us link with this script is not working. Like "https://disq.us/url?url=https://media3.giphy.com/media/l0MYEqEzwMWFCg8rm/giphy.gif:REiNKA71iAPDZrexrL63wFxLIS8&cuid=870217" this link changes to this "https://media3.giphy.com/media/l0MYEqEzwMWFCg8rm/giphy.gif:REiNKA71iAPDZrexrL63wFxLIS8". Extra portion (:REiNKA71iAPDZrexrL63wFxLIS8) at the end of link breaks it. You can check this at any website with disqus.com comment section like "https://wccftech.com/amd-reaffirms-radeon-rx-7000-rdna-3-gpu-ryzen-7000-zen-4-cpu-launch-in-2022-spending-big-money-to-secure-increased-capacity/" where clicking any gif or link other than disq.us doesn't work as expected.

This is a useful script but unfortunately, doesn't work with FireMonkey. Can you make this FireMonkey compatible please? That is a good user script manager.

Is the issue with disq.us still ongoing, I cannot seem to reproduce it. I will have to look into why it isn't working in FireMonkey, I have only used TamperMonkey and ViolentMonkey. I would certainly appreciate any help you can provide in making this script compatible with FireMonkey.

@erosman
Copy link

erosman commented Mar 9, 2022

I had a quick glance over the code.

The first thing that I noticed it the use of return which results in parse error as it is not in a function. e.g. line 67, 78, 86, 95, 105, 115, 127, 140, 156, 161, 170, 175, 180, 185

Uncaught SyntaxError: return not in function

GM|VM|TM wrap userscripts in an anonymous function in order to sandbox it and that is the reason userscript doesn't cause a parse error.

FireMonkey injects the scripts as they are. In order to use return and make it work with all userscript manager, you can wrap the code in an anonymous function e.g.

// ==UserScript==
// @run-at      document-start
// @name        General URL Cleaner Revived
// @name:ja     General URL Cleaner Revived
// @namespace   https://greasyfork.org/en/users/594496-divided-by
// @description Cleans URL's from various popular sites.
// @description:ja Cleans URL's from various popular sites.
// @include     https://www.newegg.com/*
// @include     https://www.newegg.ca/*
// @include     https://www.bing.com/*
// @include     https://www.youtube.com/*
// @include     https://www.imdb.com/*
// @include     https://www.facebook.com/*
// @include     https://disqus.com/embed/comments/*
// @include     https://www.target.com/*
// @include     /^https://[a-z]+\.amazon(\.com?)?\.[a-z]{2,3}/.*$/
// @include     /^https?://[a-z]+\.google(\.com?)?\.[a-z]{2,3}/.*$/
// @include     /^https://[a-z.]+\.ebay(desc)?(\.com?)?\.[a-z]{2,3}/.*$/
// @include     /^https://[a-z0-9.]*twitter.com/.*$/
// @include     /^https?://(www\.)?staticice\.com\.au/.*$/
// @include     https://app.getpocket.com/*
// @exclude     https://apis.google.com/*
// @exclude     https://accounts.google.com/*
// @exclude     https://support.google.com/*
// @exclude     https://www.google.com/recaptcha/*
// @exclude     https://hangouts.google.com/webchat/*
// @exclude     https://gsuite.google.com/*
// @exclude     https://calendar.google.com/*
// @exclude     https://docs.google.com/spreadsheets/*
// @exclude     https://takeout.google.com/*
// @version     4.0.1
// @license     GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Greasy+Fork+Donation
// @contributionAmount $1
// ==/UserScript==

(() => {

// the code here


})();

The following also causes a parse error as href is not defined.

let href = href;

@Ghost-BD
Copy link
Author

The issue is still there. Just go to this page and check any link in comment section to reproduce it
General URL Cleaner Revived with VM - link breakage
.

@dividedby
Copy link
Owner

The issue is still there. Just go to this page and check any link in comment section to reproduce it General URL Cleaner Revived with VM - link breakage .

Hey there, been busy with my newborn but I pushed what I hope is a fix for the disq.us link issue. I will do what I can to look into the compatibility with FireMonkey. Apologies for such sporadic updates.

@Ghost-BD
Copy link
Author

Ghost-BD commented Apr 7, 2022

Fixed but no more clean URL for disqus. Take your time as you need and congratulation by the way.
Thanks again.

@Ghost-BD Ghost-BD closed this as completed Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants