by mixologic · 8y ago · 0 comments
Thats already what the webdriver API accomplishes, and its a w3c standard. https://www.w3.org/TR/webdriver/
People still call it 'selenium' for whatever reason, but chromedriver/geckodriver/edgedriver are all implementations of the protocol for each existing browser (safari's might be built in?).
Granted the web extensions API would likely allow for some additional powerful options, but at the cost of some missing features.
They also make interacting with JavaScript on the page a bit painful. For example, injecting JavaScript into the browser with Selenium can be quite an ordeal [1], so you're somewhat limited in what you can do by what Selenium's developers decided to focus on. It also complicates deployments by adding another moving part to the overall equation.
In contrast, the Web Extension API is now part of all major browsers, and makes interacting with different page contexts effortless. To give a sense of the project, we wrote an interactive tour of Remote Browser which runs browser instances on our backend.