Này người xa lạ!

Còn chờ gì nữa mà không mau đăng nhập hoặc đăng ký để cùng tham gia thảo luận với cộng đồng!

WTF?

About: (Deleted script 16966)

Care to shed light onto why the source still points to the dead userscripts.org site?

var homepageURL = "http://userscripts.org/scripts/show/" + scriptNum;
var metaURL = "http://userscripts.org/scripts/source/" + scriptNum + ".meta.js";
var scriptJSURL = "http://userscripts.org/scripts/source/" + scriptNum + ".user.js";

And all this seems to do for me is literally RETRIEVE every single link. Only after I had to open the prefs to find all the default urls to operate on, crammed onto a single line, yet it says they must be each on their own line.......so this def needs some cleanup userscripts.org has been dead a long time hence why it's now hosted here and updates here so update the script to get rid of the old pointers and then can someone confirm this script is actually even still working properly? Do the urls need to in fact be on separate lines in the config, or all space delimited like the defaults?

Bình luận

  • Wow after debugging further this thing has a TON of basic syntax errors down to basic missing semicolons, brackets, etc.

    Needs serious fixing.

  • As far as I can tell, EVERY single a href link matches due to this thing being broken. Here's the "match" to the magic short list on just one of every A HREF hit on a page that winds up all with "unshorten" buttons despite NONE of them actually even being shortened urls:

    ["//", index: 6, input: "https://accounts.google.com/a"]
    

    Which means this line is just plain wrong on the regex causing 100% of links to match:

    if (node.href.match("/" + urls[i].replace(".", "\.") + "/"))
    

    You need to roll back to the last known working good version of this script when you have a minutes to avoid anyone else installing or upgrading to this broken version.

  • Quick update.....found big bug in code and root cause of 100% matches......all from a trailing blank line in url list does this:

    VM2737:332 bit.ly
    04:25:16.817 VM2737:333 matching: http://userscripts-mirror.org/ato: /bit.ly/
    04:25:16.817 VM2737:332 db.tt
    04:25:16.818 VM2737:333 matching: http://userscripts-mirror.org/ato: /db.tt/
    04:25:16.818 VM2737:332 dlvr.it
    04:25:16.819 VM2737:333 matching: http://userscripts-mirror.org/ato: /dlvr.it/
    04:25:16.820 VM2737:332 fb.me
    04:25:16.821 VM2737:333 matching: http://userscripts-mirror.org/ato: /fb.me/
    04:25:16.821 VM2737:332 goo.gl
    04:25:16.821 VM2737:333 matching: http://userscripts-mirror.org/ato: /goo.gl/
    04:25:16.822 VM2737:332 img.ly
    04:25:16.822 VM2737:333 matching: http://userscripts-mirror.org/ato: /img.ly/
    04:25:16.823 VM2737:332 is.gd
    04:25:16.823 VM2737:333 matching: http://userscripts-mirror.org/ato: /is.gd/
    04:25:16.823 VM2737:332 j.mp
    04:25:16.824 VM2737:333 matching: http://userscripts-mirror.org/ato: /j.mp/
    04:25:16.824 VM2737:332 ow.ly
    04:25:16.825 VM2737:333 matching: http://userscripts-mirror.org/ato: /ow.ly/
    04:25:16.825 VM2737:332 po.st
    04:25:16.826 VM2737:333 matching: http://userscripts-mirror.org/ato: /po.st/
    04:25:16.826 VM2737:332 sdrv.ms
    04:25:16.826 VM2737:333 matching: http://userscripts-mirror.org/ato: /sdrv.ms/
    04:25:16.827 VM2737:332 t.co
    04:25:16.827 VM2737:333 matching: http://userscripts-mirror.org/ato: /t.co/
    04:25:16.828 VM2737:332 tinyurl.com
    04:25:16.828 VM2737:333 matching: http://userscripts-mirror.org/ato: /tinyurl.com/
    04:25:16.829 VM2737:332 youtu.be
    04:25:16.829 VM2737:333 matching: http://userscripts-mirror.org/ato: /youtu.be/
    04:25:16.830 VM2737:332 urlin.us
    04:25:16.830 VM2737:333 matching: http://userscripts-mirror.org/ato: /urlin.us/
    04:25:16.831 VM2737:332 
    04:25:16.831 VM2737:333 matching: http://userscripts-mirror.org/ato: //
    04:25:16.831 VM2737:335 YES, http://userscripts-mirror.org/a matched with: //
    

    That is the matching running one link that should NOT match anything in the list because it is the LONG url of userscripts-mirror.org but like ALL OTHER links it DID match and now you can see why from the very last line that my debug code began with the word YES - this is where the blank null url line in the saved prefs is not being handled properly and due to the code is then converted to a test of "does the url being tested match a "//"....which is YES because every link with HTTP:"//" note my double-quotes hence the match.

    So for the time being other than fixing the syntax errors etc. be sure NOT to have any trailing line break lines or the entire script will produce wild results!

  • .....and the regex is so broken it literally matches any url right now that contains any of the portions of the shortened urls in it, regardless of position which is assinine....and means THIS below is deemed a "shortened" bitly url that gets the button/translation right back to itself (NOTE THE 2nd DEBUG ENTRY):

    bit.ly
    04:43:06.235 VM127:333 matching: https://docs.google.com/a/bit.ly/document/d/1asdadfgaasfjx6xMOggdfsoqbg/edit?usp=sharingto: /bit.ly/
    04:43:06.235 VM127:335 YES, https://docs.google.com/a/bit.ly/document/d/1asdadfgaasfjx6xMOggdfsoqbg/edit?usp=sharing matched with: /bit.ly/
    04:43:06.235 VM127:332 db.tt
    04:43:06.235 VM127:333 matching: https://docs.google.com/a/bit.ly/document/d/1asdadfgaasfjx6xMOggdfsoqbg/edit?usp=sharingto: /db.tt/
    

    I'm working on a rewrite to help clean this up and optimize it so it really does what it should and operate only on truly shortened urls etc. but everyone trying to use this now needs to be aware of these issues.

  • Hi.

    I'm probably one of 5 people in the world who use this script - and I love it!

    So any updates a competent developer can make, I'm cheerleading you!

    Don't be too harsh on the guy who tried to update the original code. He tried his best. I hope you took a look at the old discussion of the original & mod scripts over at u-mirror.

    Whatever you do though, don't mess up the custom ability to add shortening services. :smiley:

  • Thanks for the info
Đăng nhập hoặc Đăng ký để gửi bình luận.