Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all browsers that support web extensions #27

Open
tombh opened this issue Jun 12, 2018 · 17 comments
Open

Support all browsers that support web extensions #27

tombh opened this issue Jun 12, 2018 · 17 comments

Comments

@tombh
Copy link
Member

tombh commented Jun 12, 2018

The biggest hurdle is using a standardised RDP. This; https://remotedebug.org/ isn't yet supported by all browsers!

  • Chrome doesn't support extensions in headless mode! So we need to find a way to stop Chrome stealing focus on things like window resizing. Only relevant if using Browsh locally of course.
  • Chrome also has a different API for snapshoting the rendered tab.
  • Firefox still doesn't have support for the standardised RDP. It'd be nice to not have to rewrite the RDP commands for every browser. Although theoretically the RDP commands should be minimal, eg; resizing the browser window and automatically installing the extension.
@tobimensch
Copy link
Collaborator

This is low priority IMO. First iron out all problems on the firefox platform and when browsh becomes popular, other people will adapt it for other platforms such as Chrome.

@msaffer
Copy link

msaffer commented Jul 12, 2018

It would be great if this supported Chrome.

@tombh
Copy link
Member Author

tombh commented Jul 13, 2018

@msaffer I agree. But could you just give me your own reasons? Thanks.

@MrAdam
Copy link

MrAdam commented Dec 20, 2018

Just having acquired a Raspberry Pi 3 B+, I'd say the Chrome/Chromium support would be nice, as a version of firefox supported by Browsh is very hard to install on RPi3 due to an issue with armhf and the later versions of Firefox (https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1711337).

@kgfly
Copy link

kgfly commented Jul 18, 2019

+1 for chrome. Thanks. Chrome is the most popular. Even Microsoft has given up Edge/IE for chrome.

@niutech
Copy link
Contributor

niutech commented Nov 14, 2020

Can't we use any headless browser and inject a content script to every rendered web page?

@tombh
Copy link
Member Author

tombh commented Nov 14, 2020

In theory yes, but in reality there are some complicated hacks that make Browsh possible, like being able to screenshot the rendered page in order to detect the visibility of text.

@niutech
Copy link
Contributor

niutech commented Nov 15, 2020

Almost every headless browser allows to make a screenshot and access the DOM. Can't we use e.g. Playwright with multiple engines?

@niutech
Copy link
Contributor

niutech commented Nov 15, 2020

I was able to run Chromium (non-headless) with an extension using xvfb-run --server-args="-screen 0 1024x768x24" chromium-browser --remote-debugging-port=9222 --disable-gpu --load-extension=~/web-extension and chrome-remote-interface:

chromium

Next we could try loading a modified Browsh web extension using --load-extension.

@tombh
Copy link
Member Author

tombh commented Nov 16, 2020

Oh! Thanks for checking that out. So the screenshot needs to be available in code like this: https://github.com/browsh-org/browsh/blob/2f713f40fc87f5a3ca1ba15c469844c61f5f3fc6/webext/src/dom/graphics_builder.js

@niutech
Copy link
Contributor

niutech commented Nov 16, 2020

I can see you're using a deprecated Firefox-only drawWindow(), can't we use a standard captureVisibleTab() from background.js or html2canvas from the content script?

@tombh
Copy link
Member Author

tombh commented Nov 16, 2020

It's been a long time since I checked the latest Firefox API, I think current Browsh is pinned to some really old version, like v67!

@niutech
Copy link
Contributor

niutech commented Nov 16, 2020

Can we unpin it and use a standard way to capture a tab, so it works in both Firefox and Chromium?

@tombh
Copy link
Member Author

tombh commented Nov 16, 2020

Sure, but we'd need to test that

@MXP2095onetechguy
Copy link

I also want to see this with chromium, webextension can be used, but I think that browsh should support Selenium WebDriver, using that can add more browsers.

@MXP2095onetechguy
Copy link

MXP2095onetechguy commented Oct 11, 2021

Also I found this selenium webdriver client, it is for go. Browsh can use nodejs, but that would add more dependency, so here is the client.

I also found more dated webdriver clients.

Or Playwright with Playwright-Go.

Maybe that the browser can use selenium webdriver and if that is not available, then fall back playwright and then fall back to webextension.

@tombh
Copy link
Member Author

tombh commented Oct 11, 2021

I'm actually most interested in Chrome's DOMSnapshot API at the moment. It would restrict us to Chrome, but it could profoundly affect Browsh's rendering and performance. I made an issue for it: #390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants