deptoolkit icon indicating copy to clipboard operation
deptoolkit copied to clipboard

Improve SingleFile import

Open basilesimon opened this issue 3 years ago • 3 comments

Right now we're following procedure recommended by SingleFile to accomplish this.

The result, however, is a considerable skew given that the SingleFile code, which we understand and intend to use as a module, is included in the repo as if it were ours.

Maybe this is a question best asked to @gildas-lormeau, actually 👋

Is there a better way, which is more akin to a module for us and avoids us shipping your code?

Thank you so much for your help

basilesimon avatar Aug 18 '21 09:08 basilesimon

I agree that I should improve my procedure. The things that I don't like is the fact that the dist folder is hard-coded and there should be only 5 built files (2 content scripts, 1 background script and 2 web accessible resources). I don't think there is an easy way to provide this code as a module or something similar though because of the manifest.json file which must include the paths to these files.

gildas-lormeau avatar Aug 18 '21 10:08 gildas-lormeau

Hey, thanks so much for looking into this.

Would it be possible to... load these files from the internet, kind of like what unpkg.com do?

basilesimon avatar Aug 18 '21 11:08 basilesimon

I wouldn't recommend to retrieve the files from unpkg.com because browser vendors want to ensure extensions don't contain remotely hosted code, see https://developer.chrome.com/docs/extensions/mv3/intro/mv3-overview/#remotely-hosted-code and https://bugzilla.mozilla.org/show_bug.cgi?id=1594234.

gildas-lormeau avatar Aug 18 '21 15:08 gildas-lormeau