How do I bring back the full URL in the address bar? I want to see https://www.example.com
How to Get URL of FireFox Current Document?
Getting current browser url in Firefox Addon
What URLs are used to update the browser
Videos
I want to see https://www.example.com instead of just www.example.com without having to click the address bar.
getting the URL from a sidebar or popup
To retrieve the URL from a sidebar or popup requires tab permissions
"permissions": [
"tabs"
]
then you need to find the tab you want. If you just want the active tab this would work fine, for anything more advanced I'd look here.
function getPage(){
browser.tabs.query({currentWindow: true, active: true})
.then((tabs) => {
console.log(tabs[0].url);
})
}
getting the URL from injected javascript
If you want the URL for a background task I suggest this method as you do not need permissions.
this will give you a background script and then inject a script onto almost any webpage on the internet.
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"matches": ["https://www.*"],
"js": ["modify-page/URL.js"]
}
],
this will be injected into webpages through the URL js and will send a message to your background js to use.
var service= browser.runtime.connect({name:"port-from-cs"});
service.postMessage({location: document.URL});
This code is in your background js and will collect each new page's url as it changes.
var portFromCS;
function connected(p) {
portFromCS = p;
portFromCS.onMessage.addListener(function(m) {
if(m.location !== undefined){
console.log(m.location);
}
});
}
browser.runtime.onConnect.addListener(connected);
// you need to use this service first
var windowsService = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator);
// window object representing the most recent (active) instance of Firefox
var currentWindow = windowsService.getMostRecentWindow('navigator:browser');
// most recent (active) browser object - that's the document frame inside the chrome
var browser = currentWindow.getBrowser();
// object containing all the data about an address displayed in the browser
var uri = browser.currentURI;
// textual representation of the actual full URL displayed in the browser
var url = uri.spec;
Factsheet
Mozilla Corporation
Mozilla Corporation
So I have a couple of computers that shouldn't get 100% internet access but SOME things can be allowed that are essential, like browser updates.
Google Chrome currently works without any problems and they have their URLs listed.
However, FF only has, to my knowledge, one: aus5.mozilla.org
but updating fails, even with the use of wildcards.
Allowing www.mozilla.org and ftp.mozilla.org also doesn't work.
So far with those URLs it can detect that a new version is available and starts downloading with zero progress. ftp.mozilla.org at least allows me to manually download an installer but it would be nice to get auto updates working.
VeryLateUpdate:
I got this working by allowing the following FQDNs:
aus5.mozilla.org
download.mozilla.org
ftp.mozilla.org
www.mozilla.org
For some reason if I use FQDN objects it works but using CheckPoint's "Custom Application Site" object
it doesn't work (well it does but something is making it fail).
Haven't taken a deep look into why this was the case but at least it's been working for
several months.
I want to set https://www.google.com/search?q=%s&udm=14 as my default search engine. How do I do that. Looks like FF gives me a few choices of search engines but I see no where that I can add my own custom URL.
(I want to use https://www.google.com/search?q=%s&udm=14 instead of https://www.google.com because that turns off AI and other crap. Per this article: https://spectrum.ieee.org/turn-off-ai-overview-google)