Browse Source

Fixes for jpm

master
Nik Nyby 4 years ago
parent
commit
0f68d98dd2
7 changed files with 9 additions and 9 deletions
  1. +1
    -1
      install.rdf
  2. +1
    -1
      lib/js_checker/js_checker.js
  3. +1
    -1
      lib/js_load_observer/js_load_observer.js
  4. +2
    -1
      lib/script_entries/scripts_cache.js
  5. +2
    -2
      lib/settings/storage.js
  6. +1
    -2
      package.json
  7. +1
    -1
      test/mock/mock_nodes.js

+ 1
- 1
install.rdf View File

@@ -10,7 +10,7 @@
<em:description>GNU LibreJS is an add-on for Mozilla-based browsers (IceCat, Firefox, Abrowser, Iceweasel)
that prevents the execution of nonfree nontrivial JavaScript as described in &quot;The Javascript Trap&quot;: http://www.gnu.org/philosophy/javascript-trap.html</em:description>
<em:creator>Loic J. Duros</em:creator>
<em:iconURL>data/widget/images/librejs-32.png</em:iconURL>
<em:iconURL>data/widget/images/librejs-64.png</em:iconURL>
<em:homepageURL>https://gnu.org/software/librejs/</em:homepageURL>
<em:optionsURL>data:text/xml,&lt;placeholder/&gt;</em:optionsURL>
<em:optionsType>2</em:optionsType>

+ 1
- 1
lib/js_checker/js_checker.js View File

@@ -173,7 +173,7 @@ JsChecker.prototype.searchJs = function(jsCode, resultReady, 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, '');

+ 1
- 1
lib/js_load_observer/js_load_observer.js View File

@@ -53,7 +53,7 @@ ScriptAnalyzer.prototype.analyzeScriptBeforeExec = function (e) {
var script = e.target, isAccepted;
var text = script.src ?
script.src : script.textContent.substring(0,100);
var notif = require("ui/notification")
var notif = require("../ui/notification")
.createNotification(text).notification;
this.pageURL = urlHandler.removeFragment(script.ownerDocument.URL);
if (!allowedRef.urlInAllowedReferrers(this.pageURL)) {

+ 2
- 1
lib/script_entries/scripts_cache.js View File

@@ -40,7 +40,8 @@ var ScriptsCached = function() {
};

ScriptsCached.prototype.getHash = function(scriptText) {
require('ui/notification').createNotification(scriptText.substring(0,100));
require('../ui/notification').createNotification(
scriptText.substring(0,100));

return crypto.sha1Encrypt(scriptText);
};

+ 2
- 2
lib/settings/storage.js View File

@@ -23,8 +23,8 @@

const { Cc, Ci, Cu, components } = require("chrome");

var { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm");
var { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm");
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm");
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm");
var relationChecker = require("../js_checker/relation_checker")
.relationChecker;
var rc = relationChecker(); // a dummy object for legacy module.

+ 1
- 2
package.json View File

@@ -9,8 +9,7 @@
"id": "jid1-KtlZuoiikVfFew@jetpack",
"description": "GNU LibreJS is an add-on for Mozilla-based browsers (IceCat, Firefox, Abrowser, Iceweasel)\n that prevents the execution of nonfree nontrivial JavaScript as described in \"The Javascript Trap\": http://www.gnu.org/philosophy/javascript-trap.html",
"main": "lib/main.js",
"icon": "data/widget/images/librejs-32.png",
"icon64": "data/widget/images/librejs-64.png",
"icon": "data/widget/images/librejs-64.png",
"dependencies": {
"menuitem": "0.0.4",
"notification-box": "0.1.1"

+ 1
- 1
test/mock/mock_nodes.js View File

@@ -19,7 +19,7 @@
* along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>.
*/

const types = require("js_checker/constant_types").token;
const types = require("../../lib/js_checker/constant_types").token;


exports.mockNodes = {

Loading…
Cancel
Save