javascriptgoogle-chrome-extensionfirefox-addonbrowser-extensionbrowser-addons

Browser extensions: How do developers test/live code their JS for a third party website/SPA?


My question is about browser extensions written with javascript.

Tutorials for writing a browser extension always seem to use some minimal boilerplate HTML/CSS/JS as the test site (index.html = "Hello World").

So how do developers write browser extensions that target third party websites (i.e. YouTube, Twitch)?

How do they test their code without access to the website's server? Do they perform all testing on the site live and just use dev tools and keep refreshing the site manually?

If not, what is used to "live code" with javascript in this scenario? How would a developer write a browser extension and test that it works without having access to the website's source code?


Solution

  • Thanks to those who provided clarity in the comments.

    From what I can ascertain so far, the correct way to test in this scenario is to do testing on the live site using a CDP client for Python, the most popular of which being Puppeteer.

    If anyone can provide more clarity, please feel free.