diff options
Diffstat (limited to 'lib/js_checker')
-rw-r--r-- | lib/js_checker/free_checker.js | 8 | ||||
-rw-r--r-- | lib/js_checker/js_checker.js | 20 | ||||
-rw-r--r-- | lib/js_checker/nontrivial_checker.js | 2 | ||||
-rw-r--r-- | lib/js_checker/privacy_checker.js | 4 | ||||
-rw-r--r-- | lib/js_checker/relation_checker.js | 2 |
5 files changed, 19 insertions, 17 deletions
diff --git a/lib/js_checker/free_checker.js b/lib/js_checker/free_checker.js index 71a262e..be190e2 100644 --- a/lib/js_checker/free_checker.js +++ b/lib/js_checker/free_checker.js @@ -20,16 +20,16 @@ * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. */ -var licenses = require('js_checker/license_definitions'); +var licenses = require('./license_definitions'); var simpleStorage = require("sdk/simple-storage"); const LAZY = licenses.types.LAZY; var licenseRegex = []; -const END_OF_SCRIPT = require('html_script_finder/bug_fix').END_OF_SCRIPT; -const types = require("js_checker/constant_types"); +const END_OF_SCRIPT = require('../html_script_finder/bug_fix').END_OF_SCRIPT; +const types = require("./constant_types"); const token = types.token; -var patternUtils = require('js_checker/pattern_utils').patternUtils; +var patternUtils = require('./pattern_utils').patternUtils; var licStartLicEndRe = /@licstartThefollowingistheentirelicensenoticefortheJavaScriptcodeinthis(?:page|file)(.*)?@licendTheaboveistheentirelicensenoticefortheJavaScriptcodeinthis(?:page|file)/mi; var licenseMagnet = /.*@license ?(magnet\:\?xt=urn\:btih\:[0-9A-Za-z]+).*/; diff --git a/lib/js_checker/js_checker.js b/lib/js_checker/js_checker.js index 21bfeaf..ecf0826 100644 --- a/lib/js_checker/js_checker.js +++ b/lib/js_checker/js_checker.js @@ -23,16 +23,17 @@ var {Cc, Ci, Cu, Cm, Cr} = require("chrome"); -var narcissusWorker = require("parser/narcissus_worker") +var narcissusWorker = require("../parser/narcissus_worker") .narcissusWorker; -const nonTrivialModule = require("js_checker/nontrivial_checker"); -const freeChecker = require("js_checker/free_checker"); -const relationChecker = require("js_checker/relation_checker"); -const types = require("js_checker/constant_types"); +const nonTrivialModule = require("./nontrivial_checker"); +const freeChecker = require("./free_checker"); +const relationChecker = require("./relation_checker"); +const types = require("./constant_types"); -const scriptsCached = require("script_entries/scripts_cache").scriptsCached; -var isDryRun = require("addon_management/prefchange").isDryRun; +const scriptsCached = require("../script_entries/scripts_cache") + .scriptsCached; +var isDryRun = require("../addon_management/prefchange").isDryRun; var checkTypes = types.checkTypes; @@ -165,13 +166,14 @@ JsChecker.prototype.isFreeLicensed = function(script) { */ JsChecker.prototype.searchJs = function(jsCode, resultReady, url) { var that = this; - var bugfix = require('html_script_finder/bug_fix').narcissusBugFixLibreJS; + var bugfix = require('../html_script_finder/bug_fix') + .narcissusBugFixLibreJS; console.debug('JsChecker.searchJs for script url:', url); this.url = url; this.resultReady = resultReady; this.jsCode = jsCode; this.shortText = jsCode.replace(bugfix, '').substring(0,100); - this.notification = require("ui/notification") + this.notification = require("../ui/notification") .createNotification(this.shortText).notification; var verbatimCode = this.jsCode.replace(bugfix, ''); diff --git a/lib/js_checker/nontrivial_checker.js b/lib/js_checker/nontrivial_checker.js index 6a22992..1c79a2a 100644 --- a/lib/js_checker/nontrivial_checker.js +++ b/lib/js_checker/nontrivial_checker.js @@ -19,7 +19,7 @@ * You should have received a copy of the GNU General Public License * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. */ -const types = require("js_checker/constant_types"); +const types = require("./constant_types"); // constants from Narcissus for function types. const DECLARED_FORM = 0, EXPRESSED_FORM = 1, STATEMENT_FORM = 2; diff --git a/lib/js_checker/privacy_checker.js b/lib/js_checker/privacy_checker.js index f39e0b7..fe0fa8a 100644 --- a/lib/js_checker/privacy_checker.js +++ b/lib/js_checker/privacy_checker.js @@ -20,8 +20,8 @@ * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. */ -const privacyThreatJs = require('js_checker/privacy_threat_definitions.js'); -const patternUtils = require('js_checker/pattern_utils').patternUtils; +const privacyThreatJs = require('./privacy_threat_definitions.js'); +const patternUtils = require('./pattern_utils').patternUtils; exports.privacyCheck = { checkScriptPrivacyThreat: function (currentScript) { diff --git a/lib/js_checker/relation_checker.js b/lib/js_checker/relation_checker.js index c504444..21580a9 100644 --- a/lib/js_checker/relation_checker.js +++ b/lib/js_checker/relation_checker.js @@ -25,7 +25,7 @@ * Finds out if two scripts are related to each other. * */ -const types = require("js_checker/constant_types"); +const types = require("./constant_types"); const token = types.token; |