(inject, url)
| 651 | // TODO: rework the whole thing to register scripts individually with real `matches` |
| 652 | // (this will also allow proper handling of @noframes) |
| 653 | function registerScriptDataFF(inject, url) { |
| 654 | addMenuConfig(inject); |
| 655 | for (const scr of inject[SCRIPTS]) { |
| 656 | scr.code = scr[__CODE]; |
| 657 | } |
| 658 | return contentScriptsAPI.register({ |
| 659 | js: [{ |
| 660 | code: `${resolveDataCodeStr}(this,"${VIOLENTMONKEY}",${JSON.stringify(inject)})`, |
| 661 | }], |
| 662 | matches: [url.split('#', 1)[0].replace(/\*/g, '\\$&')], // escape `*` in the URL itself |
| 663 | [RUN_AT]: 'document_start', |
| 664 | }); |
| 665 | } |
| 666 | |
| 667 | function unregisterScriptFF(bag) { |
| 668 | const reg = bag[CSAPI_REG]; |
no test coverage detected