rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.68k stars 119 forks source link

Extension does not work until I reload it but ONLY via the window I didn't open. #466

Open Nakilon opened 1 week ago

Nakilon commented 1 week ago

The extension I need does not work until I reload it but only in the weird window that opens on its own. image

I've unpacked the CRX of the extension to be able to access Instagram

          browser_options: {
            "disable-extensions-except" => "#{__dir__}/../chrome_extension",
            "load-extension"            => "#{__dir__}/../chrome_extension",
          },

I could ignore the second window and use my main window handle to open the chrome://extensions/?options=makgnifbifgfobblgpnfiffljgjfjhdi to "enable working in incognito mode", etc. and go on, but the Instagram does not open (net::ERR_NAME_NOT_RESOLVED) until I press the Reload icon on the extension page and only in that second window.

How do I properly switch to that window and can't it be just one?

UPD:

browser.windows.size
=> 0
route commented 6 days ago

Hmm that requires a research, I assume you run it in a non-headless mode right?

Nakilon commented 6 days ago

a non-headless mode right?

Right.

The problem itself is now out of my scope because Instagram is paywalling (based on IP, fingerprint or whatever) after several runs and I decided to not bother with the project. But the issue is real -- I tried several times to visit the page 1) without reload 2) with pressing the reload in one window 3) in another one.