Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert browser extension to regular website

It is possible to create Chrome or Firefox extensions which open a new tab and load a webpage. Such a webpage is basically HTML with some CSS and JavaScript. Therefore, in principle, it should be possible to open this HTML page locally from the extension's source code and get the same behaviour as the extension. Or to publish the HTML, CSS and Javascript online as a regular website.

Nonetheless, opening the main HTML page of the extension does not always result in a working website. I assume that, when an extension is loaded, additional scripts are run and permissions set by the browser (see the extension API's and the manifest).

What is required to turn a browser extension into a standalone website? Are there 'wrappers' (polyfill, shim) which can read the manifest and reproduce the behaviour of the extension?

like image 372
LBogaardt Avatar asked Sep 15 '25 00:09

LBogaardt


1 Answers

Following wOxxOm's helpful comments, I realised some API calls can be intercepted using a shim or polyfill. This shim should re-implement the functions without making use of extension-specific API calls.

I created a simple Git repository containing such a Javascript shim.

like image 103
LBogaardt Avatar answered Sep 17 '25 13:09

LBogaardt