Using a web extension to package a desktop application


#1

I have a question about the general use of web extensions.

I was told that web extensions are for enhancing the browsing experience only and any other use of them would be a misuse.

Is there any reason why a web extension couldn’t or shouldn’t be used to package a desktop application instead of using Electron or a progressive web application?

For example, I have a large (50,000 lines of code) javascript program that I run in a local html page as a tool in which a user can build study modules. It uses indexedDB and backs it up to the client disk.

I was experimenting with opening an empty html file from the local disk and loading the javascript file based on the match as a content script. It seems to work fine. The only reason the local html file is needed is that the program allows for the integration of local files–such as audio, video, PDFs, images–into the study modules, and using the content script within a local html page makes it easy to use a relative path and have the same origin. If these files were not needed, then the program could potentially run in an extension page only and be opened through a browser button.

There is a games and entertainment category listed in the MDN Web Doc about “What is an extension?”, but nothing like tools or work applications is mentioned.

Since the web extension APIs, in this case at least, provide sufficient added functionality, the web extension could run this program like a desktop application without packaging the same JS, HTML, CSS files along with a Chrome browser and node.js. And that seems to be a better option for the user.

Is it “wrong” to use a web extension for this purpose? If submitted, and assuming it met all other requirements, would this type of web extension be approved and published or rejected?

Thank you.


(Jorge) #2

It’s unlikely to be rejected, I think, since it’s still a valid use to the platform (cc @TheOne and @kewisch for confirmation).

The general idea behind browser extensions is they should enhance browsing, and not just be launchers for desktop or web applications, since that’s not very useful. It sounds like you have a use case that can’t be easily addressed in other ways, so at least IMO it should be okay. Reviewing 50K lines of code will certainly make the reviewers sad, though :stuck_out_tongue:


#3

@jorgev Thank you for responding to my question.

I understand the idea of enhanced browsing in terms of adding some form of new browser functionality that can be applied to multiple web sites. The web extension APIs are attractive to web site developers also, even for simple items like knowing that a download to the client completed successfully.

I’m fairly new to web sites and everything associated with them, but it was the APIs that caused me to look at web extensions. It seems that a browser with a web extension is an attractive environment in which to build an application since the APIs keep expanding, the browser takes care of making sure they work in different operating systems, indexedDB offers good storage options, the files can be installed into the browser so the user can work offline or go online and do more within the application.

It’s difficult to find a downside, or see the added value of some of the other options for packaging HTML, CSS, JS and giving access to some parts of the operating system. Perhaps, that is simply because I don’t know enough about these areas.

It would be disappointing if the type of web extension I mentioned was to be rejected in all cases. Listing it on the AMO isn’t important to me, at least. My concern is just being able to have it published for external distribution.

Do you think I am misunderstanding the power of web extension APIs relative to Electron and progressive web apps? It would be just as easy to build the extension to provide the added functionality only and not place the full program in as the content script. It just seems easier for the user that way since it’s all packaged together.

Thank you.


(Jorge) #4

My previous response was in the context of an add-on listing on AMO. If you just need it for external distribution, then we’re not going to limit what you do (as long as it’s safe).