diff options
| author | Yuchen Pei <hi@ypei.me> | 2022-09-22 12:58:31 +1000 | 
|---|---|---|
| committer | Yuchen Pei <hi@ypei.me> | 2022-09-22 13:02:15 +1000 | 
| commit | a9ef6fc4544f208416035743a07d8ed1bb7e6736 (patch) | |
| tree | ebbc1b2a2bb1a15a7cb5b87b6aa57d555a0205d2 | |
| parent | af903283f05e628ca2e25dfb8e2745baee945b7f (diff) | |
moving some modules to common/
| -rw-r--r-- | bg/ExternalLicenses.js | 2 | ||||
| -rw-r--r-- | common/checks.js (renamed from legacy_license_check.js) | 0 | ||||
| -rw-r--r-- | common/license_definitions.js (renamed from license_definitions.js) | 0 | ||||
| -rw-r--r-- | common/pattern_utils.js (renamed from pattern_utils.js) | 0 | ||||
| -rw-r--r-- | main_background.js | 12 | 
5 files changed, 7 insertions, 7 deletions
diff --git a/bg/ExternalLicenses.js b/bg/ExternalLicenses.js index 01894b1..6eda008 100644 --- a/bg/ExternalLicenses.js +++ b/bg/ExternalLicenses.js @@ -26,7 +26,7 @@  'use strict'; -const { licenses } = require('../license_definitions') +const { licenses } = require('../common/license_definitions')  const licensesByLabel = new Map(Object.entries(licenses).map(([id, license]) =>    [      [license.identifier.toUpperCase(), license], diff --git a/legacy_license_check.js b/common/checks.js index f3c27bc..f3c27bc 100644 --- a/legacy_license_check.js +++ b/common/checks.js diff --git a/license_definitions.js b/common/license_definitions.js index d443a46..d443a46 100644 --- a/license_definitions.js +++ b/common/license_definitions.js diff --git a/pattern_utils.js b/common/pattern_utils.js index e8d62aa..e8d62aa 100644 --- a/pattern_utils.js +++ b/common/pattern_utils.js diff --git a/main_background.js b/main_background.js index c9ed6f2..48607c2 100644 --- a/main_background.js +++ b/main_background.js @@ -21,13 +21,13 @@  */  const acorn = require('acorn'); -const legacy_license_lib = require('./legacy_license_check.js'); +const licenseLib = require('./common/checks.js');  const { ResponseProcessor } = require('./bg/ResponseProcessor');  const { Storage, ListStore, hash } = require('./common/Storage');  const { ListManager } = require('./bg/ListManager');  const { ExternalLicenses } = require('./bg/ExternalLicenses'); -const { licenses } = require('./license_definitions'); -const { patternUtils } = require('./pattern_utils'); +const { licenses } = require('./common/license_definitions'); +const { patternUtils } = require('./common/pattern_utils');  console.log('main_background.js');  /** @@ -626,7 +626,7 @@ function licenseRead(scriptSrc, name, external = false) {    if (!inSrc) return [true, scriptSrc, 'Empty source.'];    // Check for @licstart .. @licend method -  const license = legacy_license_lib.check(scriptSrc); +  const license = licenseLib.check(scriptSrc);    if (license) {      return [true, scriptSrc, `Licensed under: ${license}`];    } @@ -1046,7 +1046,7 @@ async function editHtml(html, documentUrl, tabId, frameId, whitelisted) {    let license = null;    if (first_script_src != '') { -    license = legacy_license_lib.check(first_script_src); +    license = licenseLib.check(first_script_src);    }    let findLine = finder => finder.test(html) && html.substring(0, finder.lastIndex).split(/\n/).length || 0; @@ -1219,7 +1219,7 @@ async function init_addon() {    // Analyzes all the html documents and external scripts as they're loaded    ResponseProcessor.install(ResponseHandler); -  legacy_license_lib.init(); +  licenseLib.init();    const Test = require('./common/Test');    if (Test.getURL()) {  | 
