Problem with Javascript code in Firefox

User Help for Mozilla Firefox
Posts: 1
Joined: April 4th, 2019, 7:53 am

Post Posted April 4th, 2019, 8:06 am


The following code doesn't work in Firefox on bookmarks Toolbar but works in chrone (Add page)

Code: Select all
javascript:(function(){ var e,s; IB=1; function isDigit(c) { return ("0" <= c && c <= "9") } L = location.href; LL = L.length; for (e=LL-1; e>=0; --e) if (isDigit(L.charAt(e))) { for(s=e-1; s>=0; --s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e<0) return; oldNum = L.substring(s,e+1); newNum = "" + (parseInt(oldNum,10) + IB); while (newNum.length < oldNum.length) newNum = "0" + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();


User avatar
Posts: 123225
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted April 4th, 2019, 3:52 pm

Moving to Firefox Support.


User avatar
Posts: 10977
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted April 4th, 2019, 5:06 pm

Is there any error message in the Browser Console? ... er_Console


User avatar
Posts: 20406
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted April 7th, 2019, 9:47 am

Works on my end.
Increments the "digit" in a URL.
May or may not be meaningful, depending on the page you're on.

Code: Select all

Each time you click the bookmarklet, the "bih=" number increments.
Now what the "bih=" number signifies, no idea, but the number does change (though the actual page contents do not - though you will see a "refresh").

Now other extensions, setting may interfere.
NoScript does - unless you Allow the site you're running the bookmarklet on.
10: Bookmarklets Don't Work unless Site is Allowed

In the good old days, there used to be an extension, URL Flipper.
Alas, that ship has sailed.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

Posts: 3796
Joined: February 3rd, 2009, 6:29 pm

Post Posted April 7th, 2019, 9:54 am

Return to Firefox Support

Who is online

Users browsing this forum: Bing [Bot] and 9 guests