Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current page URL from a firefox sidebar extension

Tags:

I'm writing a sidebar extension for Firefox and need a way to get the URL of the current page so I can check it against a database and display the results. How can I do this?

like image 737
Hintswen Avatar asked Jan 04 '09 03:01

Hintswen


People also ask

How do I get the current URL in Firefox?

If you want to get current URL in current Firefox extension, just add content script (developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/…) and ask directly for document. location from it.

How do I use Sidebery in Firefox?

You can add Sidebery to Firefox by clicking the Add to Firefox option. Then, you'll see a Toggle Sidebery sidebar button on Firefox's URL toolbar. Click that button to view the vertical tab sidebar. Sidebery displays your open page tabs within the default panel.


1 Answers

I stumbled over this post while looking for an answer to the same question.

Actually I think it's as easy as

alert(window.content.location.href) 

See also https://developer.mozilla.org/en/DOM/window.content

like image 93
raymi Avatar answered Oct 27 '22 14:10

raymi