chromeurl

native messaging host component of chrome current url extension. exposes the current chrome browser url via a REST endpoint


Keywords
chrome, chromium, url, native
License
GPL-3.0
Install
pip install chromeurl==2022.3.7.1

Documentation

Chrome Url Extension

Installing

  • Obtain the chrome native component (python package). Options:
    • from pip
      $ pip install chromeurl
              
    • from the source tree
      $ cd native
      $ python setup.py install --user
              
  • Install the extension. Options:
    • manually from the chrome web store (preferred)
    • automatically from the web store (may require root privileges)
      $ chromeurl --install-manifest extension
              
    • from local source tree
      • navigate to chrome://extensions/
      • Load Unpacked the extension directory rooted at ./chrome
      • note the extension `ID` as UNPACKED_EXTENSION_ID
  • Native host manifest (make chrome aware of the native host). Options:
    • if extension came from the webstore
      $ sudo chromeurl --install-manifest native
              
    • if unpacked locally and loaded from source:
      $ sudo chromeurl --install-manifest native --extension-id <UNPACKED_EXTENSION_ID>
              

Get current url

  • While chrome is running, make an HTTP request to get the current url
    $ curl http://127.0.0.1:19615/tabs/current/url
    https://developer.chrome.com/extensions/activeTab
        

Debugging

  • start chromium from a terminal to see native host debug messages
  • navigate to the extension background from page (chrome://extensions) to see background page log messages

Security

  • Any local process may read the user’s current url