Mozilla webextension-polyfill (browser-polyfill.js) and licensing

This might be more an open source licensing question, than a webextension question. But I hope it is alright I post it here anyway…

I’m a beginner into browser extensions and open source licensing (and async javascript too).

I have created a webextension, Flickr Fixr, in which I have started using Mozilla’s browser-polyfill.js for easy Chrome compatibility when using the promise based webextension API.

I didn’t give licensing much (or any) thoughts when adding the browser-polyfill.js file to my project. I guess I was assuming Mozilla would allow me to use it any way I want. But my webextension is licensed under the MIT License, and browser-polyfill.js under Mozilla Public License 2.0. And when I start looking more into licensing details, I get the suspicion, that is not a valid combination because the MIT License allows more than the Mozilla license does? Or?..

Is it alright what I’m doing now, or will I have to re-license my webextension under something “stronger” like for example the Mozilla license or GNU General Public License v3.0 ?

I have copied Mozilla’s browser-polyfill.js directly into my project, partly because I don’t know anything about npm or package.json (Not even sure if they are relevant for this discussion or not?). But also because I like the simple transparency of having it that way. Do I need to add some extra information to my project telling from where I have this file, or is the information in the file itself adequate?

Btw, while working with browser-polyfill.js, I noticed it lacked support for MS Edge (it appears to be work-in-progress, but latest update is from September, so looks like it takes some time). Instead I have discovered polyfill.js from the AdBlockPlus project, which easily made my webextension MS Edge compatible. That is also an open source project, but under GNU General Public License v3.0. I assume it is the same question/conclusion if I choose to use that in the future, except Mozilla license ain’t good enough here, I will have to re-license my webextension under GPLv3 (or “stronger”)?


/Stig

Generally speaking, because extensions bundle various files together into a single distribution:

  • MPL 2 requires MPL 2-licensed files to be licensed under MPL 2-compatible terms. If you have retained the separateness of the polyfill file(s), whether you have modified them or not, then you can indicate to the user that different terms apply to your files and to the polyfill files. You are not required to license your entire extension under MPL 2.

  • GPL 3 requires your entire extension to be licensed under GPL 3-compatible terms (or GPL 3). If you (copyright owner) want to re-use your own code in a different project that doesn’t use GPL 3 code, then in that project you are not bound by how you licensed your code in this project: you would perform a fresh license compatibility analysis based on what is in that new project.

Obviously the licensing discussion can get into a lot of fine points, but that is the general philosophy.

1 Like

Thanks a lot. I give it a quick thought, and decides what to do. Really want to do things right.
Maybe it’s not a problem to make the complete extension GPL3 (if you can “thighten” license requirements from a version to next version - it seems a bit “controversial”?). But nice you can combine MPL2 and MIT in multi-file projects. Maybe I should just hope for Edge support soon in the Mozilla polyfill :slight_smile: