Return to site

Chrome extension get url of current tab

broken image
broken image

} // Called when the user clicks on the action.Ĭhrome. If the user navigates to, access is revoked. That is, if the user invokes the extension on and then navigates to, the extension will continue to have access to the page. Note: From M72 onwards, the activeTab permission will be granted until the user navigates to a different origin. This serves as an alternative for many uses of, but displays no warning message during installation:

broken image

Access to the tab lasts while the user is on that page, and is revoked when the user navigates away or closes the tab. The activeTab permission gives an extension temporary access to the currently active tab when the user invokes the extension - for example by clicking its action. In case you want to know the current URL from a content script, the standard JS way applies: () You can use properties of window.location to access individual parts of the URL, such as host, protocol or path.