Building on Rob Kennedy's answer and using NDde

Copyusing NDde.Client;

class Test
{
        public static string GetFirefoxURL()
        {
            DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo");
            dde.Connect();
            string url = dde.Request("URL", int.MaxValue);
            dde.Disconnect();
            return url;
        }
}

NB: This is very slow. It takes a few seconds on my computer. The result will look something like this :

Copy"http://stackoverflow.com/questions/430614/get-firefox-url","Get Firefox URL? - Stack Overflow",""

More info on browser DDE here.

Answer from Foole on Stack Overflow
🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1114011
What is the actual URL for the Firefox search page? I use multiple browsers and want to list the Firefox/Mozilla Search as one of the Home pages in Chrome. | Firefox Support Forum | Mozilla Support
March 12, 2016 - ''Minglewood [[#question-1114011|said]]'' <blockquote> I can't get to the Firefox/Mozilla Search in another browser without the URL, or the IP address associated with that URL, providing that the IP won't change.</blockquote> Mozilla does not operate a search engine; there's no address of any kind.
🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1057580
what is a URL and where wouldI find it | Firefox Support Forum | Mozilla Support
April 15, 2015 - You can find the full version of the current current Firefox release (37.0.1) in all languages and all operating systems here: *https://www.mozilla.org/en-US/firefox/all/ ... Not entirely sure about your question but just in case, the URL(Uniform Resource Locator) is the short, fancy name for the web address e.g.
Discussions

What URLs are used to update the browser
Can I ask what your use case is? If you are trying to block tracking you can use NextDNS which would automate all of this for you. But if this is for some other purpose we need to know what it is so we can help you better More on reddit.com
🌐 r/firefox
4
4
November 13, 2023
c# - Get Firefox URL? - Stack Overflow
How can I get the url from a running instance of firefox using .NET 2.0 windows/console app? C# or VB codes will do. Thanks! More on stackoverflow.com
🌐 stackoverflow.com
Getting current browser url in Firefox Addon
I within a panel and I want to get the current browser URL. Nothing so far works. Here's what I've tested: Only thing that even returns anything, I get something like resource://jid0- More on stackoverflow.com
🌐 stackoverflow.com
How do I bring back the full URL in the address bar? I want to see https://www.example.com
In about:config, toggle browser.urlbar.trimURLs to false. Does that work on yours? More on reddit.com
🌐 r/firefox
10
37
August 12, 2025
🌐
Mozilla Add-ons
addons.mozilla.org › en-US › firefox › addon › url-link
URL Link – Get this Extension for 🦊 Firefox (en-US)
June 17, 2022 - Download URL Link for Firefox. URL Link is a small Firefox and Thunderbird extension that allows you to select a non-URL in a mail/news message or web-page, and open it in a browser window.
Rating: 4.2 ​ - ​ 18 votes
🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1190548
What is the URL for the ORIGINAL Firefox Start Page?
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Reddit
reddit.com › r/firefox › what urls are used to update the browser
r/firefox on Reddit: What URLs are used to update the browser
November 13, 2023 -

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.

🌐
Mozilla Support
support.mozilla.org › bm › questions › 1086615
I need the URL for the Firefox startpage so I can put it in my ...
October 1, 2015 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Find elsewhere
🌐
MajorGeeks
majorgeeks.com › content › page › how_to_always_show_full_address_or_url_in_mozilla_firefox.html
How to Always Show Full Address or URL in Mozilla Firefox - MajorGeeks
Mozilla Firefox, by default, hides the https:// and www part of any URL, or web address you type in. If you'd like to see the full address all the time, here's how. The new address bar also uses a larger font. Open a new tab and type about:config in the address bar, and press Enter...
Top answer
1 of 7
17

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);
2 of 7
8
// 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;
🌐
Firefox Source Docs
firefox-source-docs.mozilla.org › toolkit › internal-urls.html
Internal URLs — Firefox Source Docs documentation
Unfortunately more fine-grained restrictions are not available for resource URLs. ... The first (“host”) component after chrome:// is the package name. Common ones are browser (for front-end Desktop Firefox files) and global (for content used by Gecko/toolkit code), but different parts ...
🌐
Pureinfotech
pureinfotech.com › home › how to show full url in address bar on firefox
How to show full URL in address bar on Firefox - Pureinfotech
June 2, 2020 - If you want to see the full URL address in Firefox, you need to configure this setting in the browser to include https and www portions.
🌐
Mozilla Support
support.mozilla.org › en-US › kb › search-firefox-address-bar
Search with the Firefox address bar - Mozilla Support
To learn more, see Address bar autocomplete suggestions in Firefox. As you type a web address or search term in the address bar, the URL autocomplete feature automatically finishes what you’re typing based on matching websites in your bookmarks, history or popular websites.
🌐
Wikipedia
en.wikipedia.org › wiki › Wikipedia:Tools › Browser_tools › Mozilla_Firefox › URL_shortcut
Wikipedia:Tools/Browser tools/Mozilla Firefox/URL shortcut - Wikipedia
Allows the user to go to a Wikipedia article from the Mozilla or Firefox address bar by typing "wp Article_Name". ... In later versions of Mozilla, you can add keyword searches more easily by right-clicking on the search field of the required site and selecting "Add a Keyword for this Search" ...
🌐
Mozilla Add-ons
addons.mozilla.org › en-US › firefox › addon › urls-list
URLs List – Get this Extension for 🦊 Firefox (en-US)
April 24, 2024 - Download URLs List for Firefox. List the URLs of all tabs from the current window as copyable plaintext. Also this extension can load a plaintext list of urls to individual tabs.
Rating: 4.5 ​ - ​ 34 votes
🌐
MozillaWiki
wiki.mozilla.org › Firefox › URL_Bar_Algorithm
Firefox/URL Bar Algorithm - MozillaWiki
January 13, 2023 - If it looks like a search according to this algorithm, insert it into the keyword.URL preference value to produce a search URL, since the keyword.enabled preference defaults to true in Firefox.
🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1349764
How to find the URL to use for ExtensionSettings? | Firefox for Enterprise Support Forum | Mozilla Support
September 7, 2021 - I know how to find it in Chrome but I'm now trying for FireFox. I've had a hard time and it's not as clear as the direct GPO implementation as Chrome uses. My next thing to figure out is when extension settings are mentioned in multiple levels of the GPO hierarchy. That's a separate question and not needed for an answer to this question. I only mention it as someone who knows one part is likely to know the other as well. Thanks, -g · You only need the URL if you want to install the extension.
🌐
Mozilla Support
support.mozilla.org › en-US › kb › how-share-urls-firefox-macos
How to share URLs on Firefox for macOS - Mozilla Support
August 6, 2024 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser