Add Node.js to the project (npm init), use babel to transpile our source files and use webpack to bundle vendor files and our source files.
Bundles:
app.bundle.js transpile and bundle our source files (at the moment, content.js and rules.js)
vendor.bundle.js bundle all third-party libraries used (at the moment, only jQuery lib)
All bundles should be generated to build/ folder.
Update manifest.json to load bundle files instead of directly loading our source files
A aplicação deverá ter um arquivo de regras de transformação rules.js que será lido em content.js.
Esse arquivo deve fornecer uma lista (array) de regras de transformação de texto.
Cada regra deverá fornecer:
Atributo
Tipo
Descrição
selector
string / regex
String ou RegEx que será usado para selecionar texto
target
string
Resultado da transformação. É possível utilizar $& para referenciar o texto selecionado.
As regras deverão ser processadas em ordem que forem declaradas em rules.js
The extension actually handles DOM Elements and text transforms at page loading. So, if the DOM is rendered (or re-rendered) after the page is loaded, the extension won't capture the text and won't transform.
Maybe use some DOM Rendering events to trigger text transform?