How to get the currently opened url in rust

Dear Rust-Community,

this is my first post in this forum.

Now I try to code my own password manager.

After I use a hot key, he shall read the url, which I have currently opened in my web browser (firefox).

But I don't find a library to get the url for rust.

Do you know any library in Rust which I can employ?

If not, is there another library in python or any other languages?

Or do you know any other solutions for that?

Thank you for any help.



You will have to write a Firefox extension for that, and probably some form of IPC to enable the extension to communicate with the app.

Ok, now that I have some time to write a more useful response, here are some resources to get you started:

  • Start with the tutorial: Your first extension
  • The JavaScript in your add-on will have access to the DOM, and global document and window objects, so getting the page URL is just document.location.href
  • You can also use "background scripts" instead of "content scripts", which are more powerful.
  • The easiest way to do IPC between an extension/add-on and a native app is probably running an HTTP server in the app and making requests within the extension. The extension may need special permissions to send requests to localhost.
  • A better way to do IPC is using native messaging
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.