lfilho / sample-webextension Goto Github PK
View Code? Open in Web Editor NEWTest project developing a browser extension with WebExtension APIs.
Test project developing a browser extension with WebExtension APIs.
The purpose of this task is get familiar with the basic steps to what it takes to package and release an extension. The extension itself won't have any use at this moment.
AAC, I want to be able to install the extension in my browser and see an alert box coming from it
Given the learnings from #4, automate
See #6
Jest will be used for unit testing. Later on we need to investigate if Jest can be a driver for playwright and the e2e tests.
Will assume a metrics service exist and only mock calls that would happen to such service instead. Will use localStorage
under the hood instead.
I'll also set up lint-staged
and husky
, so eslint and prettier run automatically before each commit, ensuring we always push formatted and linted files. :-)
I will decide later on if we need to use babel, weback or snowpack. Right now it seems the code will be simple enough, with very few dependencies, so we might not need the extra complexity of babel, webpack and etc.
If in the end we need it, I will consider Snowpack instead of webpack. Snowpack assumes we're running a modern browser, capable of ESM, so we wouldn't need webpack or babel transpilation when it comes to import
syntax of ESM.
In the future, if needed, we could easily plug babel or snowpack in to generate a standar production bundle of the code.
Initial thoughts:
With error codes, helpful debugging errors and also user-friendly errors that can be translated in the future
Remember to update the dev docs with it
See similar considerations about performance on #7
mailto:
link.One could argue we should private by default and in this situation block it instead.
The reasoning here is: deny lists are usually big lists not defined by the user (fetched by some general authoritative source -- like ourselves, EFF, etc). But allow lists are usually defined locally, by the users, so in that case we should trust they indeed wanted that override and hence use it as the driver of our decision here.
This will be an important part for automatic releases and also tests.
By auto generating new releases we could later on even automate the upload of the latest releases to the browsers stores and our community could also subscribe to Github notifications and always be in the know when we release a new version.
We will use Github Actions
but the necessary scripts will be written in a way we could easily port them to other platforms in the future if needed be.
First real release of a usable extension! 🎉
AAC, I want to access a site with a known tracker and not be tracked
For this MVP we'll probably will go with a simple Set (<= O(n)
as per javascript Set specification).
But for the future we need to consider the best data structure and matching algorithm for the deny / allow lists. Imaging they could get pretty huge, we need to consider performing cases like the ones below. But even then we should confirm those assumptions with load tests and some data gathering about how big those lists can realistically get.
Out automerge workflow checks for our ops-bot
user in order to kick in and auto merge our release auto-cut PRs.
We're using a repo-scoped PAT (Personal Access Token). This mean that the github.actor
in our github action will be whichever user generated that token (lfilho
in this case).
See https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs for more details.
We probably want to do https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork as it's the most secure approach.
As I'm the only developer here so far, I have just changed the check to accept my username and instead I'm adding another condition to check for the specific automerge
label.
To ensure there's not, for example, a lingering configuration that persisted from previous tests, or conflicting configuration from other extensions or browser configurations from other profiles.
When testing locally, web-ext
tool abstracts some steps for us like installing it on the browser and giving the temporary permissions, so by running this test, without web-ext
doing it for us, we ensure there's nothing web-ext
is doing under the hood that might blindfold us later
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.