X
Thinta lapha ukuze uye kuveshini yamakhalekhukhwini kusayithi.

Isithangami Sabeseki

Bookmarklets do not work on selecting text and clicking - is there a way to fix? Works fine in Chrome.

Kuphostiwe

I have a following bookmarklet which works perfectly in Chrome. However, it does not work in Firefox whenever the text is not "printed" on the page. Is there a way to fix this?

Bookmarklet:

```javascript:(function(){var%20t=window.getSelection?window.getSelection().toString():document.selection.createRange().text;%20window.open("https://wwwapps.ups.com/WebTracking/track?track.x=Track&trackNums="+t.trim());})()```

Function: On selecting a UPS tracking code and clicking the bookmarklet, you get to a page with the tracking updates

Chrome functionality: see this link ```https://drive.google.com/file/d/1x0YZwZaW_wg5I51RfUvb34yu7-CSiBGb/view?usp=sharing```

I have a following bookmarklet which works perfectly in Chrome. However, it does not work in Firefox whenever the text is not "printed" on the page. Is there a way to fix this? Bookmarklet: ```javascript:(function(){var%20t=window.getSelection?window.getSelection().toString():document.selection.createRange().text;%20window.open("https://wwwapps.ups.com/WebTracking/track?track.x=Track&trackNums="+t.trim());})()``` Function: On selecting a UPS tracking code and clicking the bookmarklet, you get to a page with the tracking updates Chrome functionality: see this link ```https://drive.google.com/file/d/1x0YZwZaW_wg5I51RfUvb34yu7-CSiBGb/view?usp=sharing```
Isicaphuno

Eminye Imininingwane Yohlelo

Isisebenziso

  • I-ejenti Engumsebenzisi: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Eminye Imininingwane

TyDraniu
  • Top 25 Contributor
192 izisombululo 1144 izimpendulo

This bookmarklet works for me, when I use tracking code from the page. But you're taking the code from some text input field, then it can't work.

In that case, instead

var%20t=window.getSelection?window.getSelection().toString():document.selection.createRange().text;

you should use sth like

var%20t=document.getElementById('xxxxx').value;

(change xxxxxx to ID of your input field).

This bookmarklet works for me, when I use tracking code from the page. But you're taking the code from some text input field, then it can't work. In that case, instead var%20t=window.getSelection?window.getSelection().toString():document.selection.createRange().text; you should use sth like var%20t=document.getElementById('xxxxx').value; (change xxxxxx to ID of your input field).
Ingabe lokhu kube usizo kuwena?
Isicaphuno

Umnikazi wombuzo

Thank you! Yes, this does work for a specific field (better this than nothing) but I was wondering if there is a way to apply the bookmarklet anywhere on the page like in Chrome by simply selecting the text in the input field and then clicking the bookmarklet. If not, I will (very reluctantly) have to resort to using Chrome :(

Thank you! Yes, this does work for a specific field (better this than nothing) but I was wondering if there is a way to apply the bookmarklet anywhere on the page like in Chrome by simply selecting the text in the input field and then clicking the bookmarklet. If not, I will (very reluctantly) have to resort to using Chrome :(
Ingabe lokhu kube usizo kuwena?
Isicaphuno
Buza umbuzo

Kufanele ulogele ukungena ku-akhawunti yakho ukuze uphendule amaphosti. Uyacelwauqale umbuzo omusha, uma ungekabi nayo i-akhawunti namanje.