get-windows icon indicating copy to clipboard operation
get-windows copied to clipboard

Question about Firefox

Open Srini-B opened this issue 2 years ago • 1 comments

Hi, can anyone confirm me if URLs from Firefox are captured, It doesn't work for me. I also have userchrome.css enabled which modifies the UI, maybe it's the cause. I'm on macOS 13.0.1

Srini-B avatar Nov 23 '22 04:11 Srini-B

I'm having the same issue, URLs are not captured from Firefox

anis-dr avatar Jul 13 '23 17:07 anis-dr

This is because it does not work with the approach this library uses (which is to use AppleScript to 'tell' the browser to return it's url). I solved this a while ago on my macOS project. You can actually use Accessibility API to get it.

  1. You need to set AXManualAccessibility on the Firefox process, which will enable it's DOM to be visible (this property tells the app a 'Screen reader' is present on the screen, so this is a sort of a hack).
  2. Traverse the Firefox's DOM (consisting of AXUIElement) using BFS until you find a node that has a url attribute and read that.

It's a hassle to add this, but unfortunately, no better way to do this for Firefox. I read their forums a while back.

vojtabohm avatar Jul 12 '24 17:07 vojtabohm

Duplicate of #172

sindresorhus avatar Aug 09 '24 23:08 sindresorhus