MozillaZine

Problem with Javascript code in Firefox

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

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

Hi

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


http://uupload.ir/files/fx8c_ggh.jpg



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); })();

DanRaisch
Moderator

User avatar
 
Posts: 123667
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.

jscher2000

User avatar
 
Posts: 11062
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? https://developer.mozilla.org/docs/Tool ... er_Console

therube

User avatar
 
Posts: 20550
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.

URL:
Code: Select all
https://www.google.com/search?q=uniplex+word+processor&tbm=isch&source=univ&client=firefox-b-1-d&sa=X&ved=2ahUKEwjux9CdjJPhAhVJvFkKHdSWDFkQsAR6BAgGEAE&biw=1920&bih=1008

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.
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

morat
 
Posts: 3981
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], Google [Bot] and 5 guests