Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Synzvato/decentraleyes
  • gkrishnaks/decentraleyes
  • ExE-Boss/decentraleyes
  • whtsky/decentraleyes
  • grtgarrett/decentraleyes
  • An_dz/decentraleyes
  • Alaska/decentraleyes
  • finn/decentraleyes
  • klippy/decentraleyes
9 results
Show changes
Showing
with 1233 additions and 814 deletions
/**
* Resource Environments
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-07-24 (originally "files")
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* Public Constants
*/
const stable = {
// AngularJS
'resources/angularjs/1.0.1/angular.min.jsm': true,
'resources/angularjs/1.0.2/angular.min.jsm': true,
'resources/angularjs/1.0.3/angular.min.jsm': true,
'resources/angularjs/1.0.4/angular.min.jsm': true,
'resources/angularjs/1.0.5/angular.min.jsm': true,
'resources/angularjs/1.0.6/angular.min.jsm': true,
'resources/angularjs/1.0.8/angular.min.jsm': true,
'resources/angularjs/1.2.0/angular.min.jsm': true,
'resources/angularjs/1.2.1/angular.min.jsm': true,
'resources/angularjs/1.2.10/angular.min.jsm': true,
'resources/angularjs/1.2.15/angular.min.jsm': true,
'resources/angularjs/1.2.16/angular.min.jsm': true,
'resources/angularjs/1.2.20/angular.min.jsm': true,
'resources/angularjs/1.2.23/angular.min.jsm': true,
'resources/angularjs/1.2.26/angular.min.jsm': true,
'resources/angularjs/1.2.28/angular.min.jsm': true,
'resources/angularjs/1.2.29/angular.min.jsm': true,
'resources/angularjs/1.3.0/angular.min.jsm': true,
'resources/angularjs/1.3.3/angular.min.jsm': true,
'resources/angularjs/1.3.8/angular.min.jsm': true,
'resources/angularjs/1.3.10/angular.min.jsm': true,
'resources/angularjs/1.3.11/angular.min.jsm': true,
'resources/angularjs/1.3.14/angular.min.jsm': true,
'resources/angularjs/1.3.15/angular.min.jsm': true,
'resources/angularjs/1.4.0/angular.min.jsm': true,
'resources/angularjs/1.4.2/angular.min.jsm': true,
'resources/angularjs/1.4.8/angular.min.jsm': true,
// Backbone.js
'resources/backbone.js/0.9.0/backbone-min.jsm': true,
'resources/backbone.js/0.9.1/backbone-min.jsm': true,
'resources/backbone.js/0.9.2/backbone-min.jsm': true,
'resources/backbone.js/0.9.9/backbone-min.jsm': true,
'resources/backbone.js/0.9.10/backbone-min.jsm': true,
'resources/backbone.js/1.0.0/backbone-min.jsm': true,
'resources/backbone.js/1.1.0/backbone-min.jsm': true,
'resources/backbone.js/1.1.1/backbone-min.jsm': true,
'resources/backbone.js/1.1.2/backbone-min.jsm': true,
'resources/backbone.js/1.2.0/backbone-min.jsm': true,
'resources/backbone.js/1.2.1/backbone-min.jsm': true,
'resources/backbone.js/1.2.2/backbone-min.jsm': true,
'resources/backbone.js/1.2.3/backbone-min.jsm': true,
// Dojo
'resources/dojo/1.4.1/dojo/dojo.jsm': true,
'resources/dojo/1.4.5/dojo/dojo.jsm': true,
'resources/dojo/1.5.0/dojo/dojo.jsm': true,
'resources/dojo/1.6.1/dojo/dojo.jsm': true,
'resources/dojo/1.7.5/dojo/dojo.jsm': true,
'resources/dojo/1.8.3/dojo/dojo.jsm': true,
'resources/dojo/1.8.7/dojo/dojo.jsm': true,
'resources/dojo/1.8.9/dojo/dojo.jsm': true,
'resources/dojo/1.9.1/dojo/dojo.jsm': true,
'resources/dojo/1.9.3/dojo/dojo.jsm': true,
'resources/dojo/1.9.7/dojo/dojo.jsm': true,
'resources/dojo/1.10.4/dojo/dojo.jsm': true,
// Ember.js
'resources/ember.js/1.0.1/ember.min.jsm': true,
'resources/ember.js/1.1.3/ember.min.jsm': true,
'resources/ember.js/1.2.2/ember.min.jsm': true,
'resources/ember.js/1.3.2/ember.min.jsm': true,
'resources/ember.js/1.4.0/ember.min.jsm': true,
'resources/ember.js/1.5.1/ember.min.jsm': true,
'resources/ember.js/2.0.0/ember.min.jsm': true,
'resources/ember.js/2.0.2/ember.min.jsm': true,
'resources/ember.js/2.1.0/ember.min.jsm': true,
// Ext Core
'resources/ext-core/3.0.0/ext-core.jsm': true,
'resources/ext-core/3.1.0/ext-core.jsm': true,
// jQuery
'resources/jquery/1.2.3/jquery.min.jsm': true,
'resources/jquery/1.2.6/jquery.min.jsm': true,
'resources/jquery/1.3.0/jquery.min.jsm': true,
'resources/jquery/1.3.1/jquery.min.jsm': true,
'resources/jquery/1.3.2/jquery.min.jsm': true,
'resources/jquery/1.4.0/jquery.min.jsm': true,
'resources/jquery/1.4.1/jquery.min.jsm': true,
'resources/jquery/1.4.2/jquery.min.jsm': true,
'resources/jquery/1.4.3/jquery.min.jsm': true,
'resources/jquery/1.4.4/jquery.min.jsm': true,
'resources/jquery/1.5.0/jquery.min.jsm': true,
'resources/jquery/1.5.1/jquery.min.jsm': true,
'resources/jquery/1.5.2/jquery.min.jsm': true,
'resources/jquery/1.6.0/jquery.min.jsm': true,
'resources/jquery/1.6.1/jquery.min.jsm': true,
'resources/jquery/1.6.2/jquery.min.jsm': true,
'resources/jquery/1.6.3/jquery.min.jsm': true,
'resources/jquery/1.6.4/jquery.min.jsm': true,
'resources/jquery/1.7.0/jquery.min.jsm': true,
'resources/jquery/1.7.1/jquery.min.jsm': true,
'resources/jquery/1.7.2/jquery.min.jsm': true,
'resources/jquery/1.8.0/jquery.min.jsm': true,
'resources/jquery/1.8.1/jquery.min.jsm': true,
'resources/jquery/1.8.2/jquery.min.jsm': true,
'resources/jquery/1.8.3/jquery.min.jsm': true,
'resources/jquery/1.9.0/jquery.min.jsm': true,
'resources/jquery/1.9.1/jquery.min.jsm': true,
'resources/jquery/1.10.0/jquery.min.jsm': true,
'resources/jquery/1.10.1/jquery.min.jsm': true,
'resources/jquery/1.10.2/jquery.min.jsm': true,
'resources/jquery/1.11.0/jquery.min.jsm': true,
'resources/jquery/1.11.1/jquery.min.jsm': true,
'resources/jquery/1.11.2/jquery.min.jsm': true,
'resources/jquery/1.11.3/jquery.min.jsm': true,
'resources/jquery/1.12.0/jquery.min.jsm': true,
'resources/jquery/1.12.1/jquery.min.jsm': true,
'resources/jquery/1.12.2/jquery.min.jsm': true,
'resources/jquery/1.12.3/jquery.min.jsm': true,
'resources/jquery/1.12.4/jquery.min.jsm': true,
'resources/jquery/2.0.0/jquery.min.jsm': true,
'resources/jquery/2.0.1/jquery.min.jsm': true,
'resources/jquery/2.0.2/jquery.min.jsm': true,
'resources/jquery/2.0.3/jquery.min.jsm': true,
'resources/jquery/2.1.0/jquery.min.jsm': true,
'resources/jquery/2.1.1/jquery.min.jsm': true,
'resources/jquery/2.1.3/jquery.min.jsm': true,
'resources/jquery/2.1.4/jquery.min.jsm': true,
// jQuery UI
'resources/jqueryui/1.5.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.6.0/jquery-ui.min.jsm': true,
'resources/jqueryui/1.7.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.8.24/jquery-ui.min.jsm': true,
'resources/jqueryui/1.9.2/jquery-ui.min.jsm': true,
'resources/jqueryui/1.10.4/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.0/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.1/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.2/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.4/jquery-ui.min.jsm': true,
// Modernizr
'resources/modernizr/2.6.2/modernizr.min.jsm': true,
'resources/modernizr/2.7.1/modernizr.min.jsm': true,
'resources/modernizr/2.7.2/modernizr.min.jsm': true,
'resources/modernizr/2.8.2/modernizr.min.jsm': true,
'resources/modernizr/2.8.3/modernizr.min.jsm': true,
// MooTools
'resources/mootools/1.1.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.1.2/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.3/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.4/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.5/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.0/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.2/mootools-yui-compressed.jsm': true,
'resources/mootools/1.4.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.4.5/mootools-yui-compressed.jsm': true,
'resources/mootools/1.5.0/mootools-yui-compressed.jsm': true,
'resources/mootools/1.5.1/mootools-yui-compressed.jsm': true,
// Prototype
'resources/prototype/1.6.0.2/prototype.jsm': true,
'resources/prototype/1.6.0.3/prototype.jsm': true,
'resources/prototype/1.6.1.0/prototype.jsm': true,
'resources/prototype/1.7.0.0/prototype.jsm': true,
'resources/prototype/1.7.1.0/prototype.jsm': true,
'resources/prototype/1.7.2.0/prototype.jsm': true,
'resources/prototype/1.7.3.0/prototype.jsm': true,
// Scriptaculous
'resources/scriptaculous/1.8.1/scriptaculous.jsm': true,
'resources/scriptaculous/1.8.2/scriptaculous.jsm': true,
'resources/scriptaculous/1.8.3/scriptaculous.jsm': true,
'resources/scriptaculous/1.9.0/scriptaculous.jsm': true,
// SWFObject
'resources/swfobject/2.1/swfobject.jsm': true,
'resources/swfobject/2.2/swfobject.jsm': true,
// Underscore.js
'resources/underscore.js/1.3.0/underscore-min.jsm': true,
'resources/underscore.js/1.3.1/underscore-min.jsm': true,
'resources/underscore.js/1.3.3/underscore-min.jsm': true,
'resources/underscore.js/1.4.0/underscore-min.jsm': true,
'resources/underscore.js/1.4.1/underscore-min.jsm': true,
'resources/underscore.js/1.4.2/underscore-min.jsm': true,
'resources/underscore.js/1.4.3/underscore-min.jsm': true,
'resources/underscore.js/1.4.4/underscore-min.jsm': true,
'resources/underscore.js/1.5.0/underscore-min.jsm': true,
'resources/underscore.js/1.5.1/underscore-min.jsm': true,
'resources/underscore.js/1.5.2/underscore-min.jsm': true,
'resources/underscore.js/1.6.0/underscore-min.jsm': true,
'resources/underscore.js/1.7.0/underscore-min.jsm': true,
'resources/underscore.js/1.8.0/underscore-min.jsm': true,
'resources/underscore.js/1.8.1/underscore-min.jsm': true,
'resources/underscore.js/1.8.2/underscore-min.jsm': true,
'resources/underscore.js/1.8.3/underscore-min.jsm': true,
// Web Font Loader
'resources/webfont/1.0.0/webfont.jsm': true,
'resources/webfont/1.0.1/webfont.jsm': true,
'resources/webfont/1.0.2/webfont.jsm': true,
'resources/webfont/1.0.3/webfont.jsm': true,
'resources/webfont/1.0.4/webfont.jsm': true,
'resources/webfont/1.0.5/webfont.jsm': true,
'resources/webfont/1.0.6/webfont.jsm': true,
'resources/webfont/1.0.9/webfont.jsm': true,
'resources/webfont/1.0.10/webfont.jsm': true,
'resources/webfont/1.0.11/webfont.jsm': true,
'resources/webfont/1.0.12/webfont.jsm': true,
'resources/webfont/1.0.13/webfont.jsm': true,
'resources/webfont/1.0.14/webfont.jsm': true,
'resources/webfont/1.0.15/webfont.jsm': true,
'resources/webfont/1.0.16/webfont.jsm': true,
'resources/webfont/1.0.17/webfont.jsm': true,
'resources/webfont/1.0.18/webfont.jsm': true,
'resources/webfont/1.0.19/webfont.jsm': true,
'resources/webfont/1.0.21/webfont.jsm': true,
'resources/webfont/1.0.22/webfont.jsm': true,
'resources/webfont/1.0.23/webfont.jsm': true,
'resources/webfont/1.0.24/webfont.jsm': true,
'resources/webfont/1.0.25/webfont.jsm': true,
'resources/webfont/1.0.26/webfont.jsm': true,
'resources/webfont/1.0.27/webfont.jsm': true,
'resources/webfont/1.0.28/webfont.jsm': true,
'resources/webfont/1.0.29/webfont.jsm': true,
'resources/webfont/1.0.30/webfont.jsm': true,
'resources/webfont/1.0.31/webfont.jsm': true,
'resources/webfont/1.1.0/webfont.jsm': true,
'resources/webfont/1.1.1/webfont.jsm': true,
'resources/webfont/1.1.2/webfont.jsm': true,
'resources/webfont/1.3.0/webfont.jsm': true,
'resources/webfont/1.4.2/webfont.jsm': true,
'resources/webfont/1.4.6/webfont.jsm': true,
'resources/webfont/1.4.7/webfont.jsm': true,
'resources/webfont/1.4.8/webfont.jsm': true,
'resources/webfont/1.4.10/webfont.jsm': true,
'resources/webfont/1.5.0/webfont.jsm': true,
'resources/webfont/1.5.2/webfont.jsm': true,
'resources/webfont/1.5.3/webfont.jsm': true,
'resources/webfont/1.5.6/webfont.jsm': true,
'resources/webfont/1.5.10/webfont.jsm': true,
'resources/webfont/1.5.18/webfont.jsm': true
};
const staging = {...stable, ...{
// AngularJS
'resources/angularjs/1.5.8/angular.min.jsm': true,
'resources/angularjs/1.6.1/angular.min.jsm': true,
'resources/angularjs/1.6.5/angular.min.jsm': true,
// Backbone.js
'resources/backbone.js/1.3.3/backbone-min.jsm': true,
'resources/backbone.js/1.4.0/backbone-min.jsm': true,
// jQuery
'resources/jquery/2.2.0/jquery.min.jsm': true,
'resources/jquery/2.2.1/jquery.min.jsm': true,
'resources/jquery/2.2.2/jquery.min.jsm': true,
'resources/jquery/2.2.3/jquery.min.jsm': true,
'resources/jquery/2.2.4/jquery.min.jsm': true,
'resources/jquery/3.0.0/jquery.min.jsm': true,
'resources/jquery/3.1.0/jquery.min.jsm': true,
'resources/jquery/3.1.1/jquery.min.jsm': true,
'resources/jquery/3.2.0/jquery.min.jsm': true,
'resources/jquery/3.2.1/jquery.min.jsm': true,
'resources/jquery/3.3.1/jquery.min.jsm': true,
'resources/jquery/3.4.0/jquery.min.jsm': true,
'resources/jquery/3.4.1/jquery.min.jsm': true,
'resources/jquery/3.5.0/jquery.min.jsm': true,
'resources/jquery/3.5.1/jquery.min.jsm': true,
'resources/jquery/3.6.0/jquery.min.jsm': true,
'resources/jquery/3.6.1/jquery.min.jsm': true,
'resources/jquery/3.6.4/jquery.min.jsm': true,
'resources/jquery/3.7.0/jquery.min.jsm': true,
'resources/jquery/3.7.1/jquery.min.jsm': true,
// Moment.js
'resources/moment.js/2.8.3/moment.min.jsm': true,
'resources/moment.js/2.8.4/moment.min.jsm': true,
'resources/moment.js/2.10.2/moment.min.jsm': true,
'resources/moment.js/2.10.3/moment.min.jsm': true,
'resources/moment.js/2.10.6/moment.min.jsm': true,
'resources/moment.js/2.11.1/moment.min.jsm': true,
'resources/moment.js/2.11.2/moment.min.jsm': true,
'resources/moment.js/2.17.0/moment.min.jsm': true,
'resources/moment.js/2.17.1/moment.min.jsm': true,
'resources/moment.js/2.18.1/moment.min.jsm': true,
'resources/moment.js/2.19.1/moment.min.jsm': true,
'resources/moment.js/2.19.2/moment.min.jsm': true,
'resources/moment.js/2.19.3/moment.min.jsm': true,
'resources/moment.js/2.20.1/moment.min.jsm': true,
'resources/moment.js/2.22.0/moment.min.jsm': true,
'resources/moment.js/2.22.1/moment.min.jsm': true,
'resources/moment.js/2.22.2/moment.min.jsm': true,
'resources/moment.js/2.24.0/moment.min.jsm': true,
'resources/moment.js/2.29.1/moment.min.jsm': true,
'resources/moment.js/2.29.4/moment.min.jsm': true,
// Underscore.js
'resources/underscore.js/1.9.0/underscore-min.jsm': true,
'resources/underscore.js/1.9.1/underscore-min.jsm': true,
'resources/underscore.js/1.13.4/underscore-min.jsm': true
}};
/**
* Exports
*/
export default {
stable,
staging
};
/**
* Resource Mappings
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-05-30
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import ResourceSets from './sets.js';
/**
* Public Constants
*/
const mappings = {
// Google Hosted Libraries
'ajax.googleapis.com': {
'/ajax/libs/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'ext-core/{version}/ext-core-debug.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'webfont/{version}/webfont.': ResourceSets.webfont,
// Mapping Aliases [Deprecated]
'dojo/1/dojo/dojo.': {
'path': 'resources/dojo/1.6.1/dojo/dojo.jsm',
'type': 'application/javascript'
},
'jquery/1/jquery.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
},
'jqueryui/1/jquery-ui.js': {
'path': 'resources/jqueryui/1.10.4/jquery-ui.min.jsm',
'type': 'application/javascript'
},
'jqueryui/1/jquery-ui.min.js': {
'path': 'resources/jqueryui/1.10.4/jquery-ui.min.jsm',
'type': 'application/javascript'
},
'mootools/1/mootools-yui-compressed.': {
'path': 'resources/mootools/1.1.2/mootools-yui-compressed.jsm',
'type': 'application/javascript'
},
'prototype/1/prototype.': {
'path': 'resources/prototype/1.7.1.0/prototype.jsm',
'type': 'application/javascript'
},
'scriptaculous/1/scriptaculous.': {
'path': 'resources/scriptaculous/1.9.0/scriptaculous.jsm',
'type': 'application/javascript'
},
'swfobject/2/swfobject.': {
'path': 'resources/swfobject/2.2/swfobject.jsm',
'type': 'application/javascript'
},
'webfont/1/webfont.': {
'path': 'resources/webfont/1.5.18/webfont.jsm',
'type': 'application/javascript'
}
}
},
// Microsoft Ajax CDN
'ajax.aspnetcdn.com': {
'/ajax/': {
'jQuery/jquery-{version}.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'modernizr/modernizr-{version}.': ResourceSets.modernizr
}
},
// Microsoft Ajax CDN [Deprecated]
'ajax.microsoft.com': {
'/ajax/': {
'jQuery/jquery-{version}.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'modernizr/modernizr-{version}.': ResourceSets.modernizr
}
},
// CDNJS (Cloudflare)
'cdnjs.cloudflare.com': {
'/ajax/libs/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'moment.js/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-core': ResourceSets.mootools,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont': ResourceSets.webfont
}
},
// jQuery CDN (Fastly)
'code.jquery.com': {
'/': {
'jquery-{version}.': ResourceSets.jQuery,
'ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
// Mapping Aliases [Deprecated]
'jquery-latest.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
},
'jquery.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
}
}
},
// jsDelivr (Cloudflare, Fastly)
'cdn.jsdelivr.net': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbonejs/{version}/backbone.': ResourceSets.backbone,
'backbonejs/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'emberjs/{version}/ember.': ResourceSets.ember,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery.ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery.ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'momentjs/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-': ResourceSets.mootools,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscorejs/{version}/underscore.': ResourceSets.underscore,
'underscorejs/{version}/underscore-min.': ResourceSets.underscore,
'webfontloader/{version}/webfont': ResourceSets.webfont
}
},
// Yandex CDN
'yastatic.net': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'backbone/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'momentjs/{version}/moment.': ResourceSets.moment,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore
}
},
// Yandex CDN [Deprecated]
'yandex.st': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'backbone/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'momentjs/{version}/moment.': ResourceSets.moment,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore
}
},
// Baidu CDN
'apps.bdimg.com': {
'/libs/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'moment/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'swfobject/{version}/swfobject_src.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// Baidu CDN [Deprecated]
'libs.baidu.com': {
'/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'moment/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'swfobject/{version}/swfobject_src.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// Sina Public Resources
'lib.sinaapp.com': {
'/js/': {
'angular.js/angular-{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'ext-core/{version}/ext-core-debug.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'mootools/{version}/mootools.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// UpYun Library
'upcdn.b0.upaiyun.com': {
'/libs/': {
'dojo/dojo-{version}.': ResourceSets.dojo,
'emberjs/emberjs-{version}.': ResourceSets.ember,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'jqueryui/jquery.ui-{version}.js': ResourceSets.jQueryUI,
'jqueryui/jquery.ui-{version}.min.js': ResourceSets.jQueryUI,
'modernizr/modernizr-{version}.': ResourceSets.modernizr,
'mootoolscore/mootools.core-{version}.': ResourceSets.mootools
}
},
// Tencent Cloud CDN
'mat1.gtimg.com': {
'/libs/': {
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery
}
},
// BootCDN [Dissolved]
'cdn.bootcss.com': {
'/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'moment.js/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfontloader.': ResourceSets.webfont
}
}
};
/**
* Initializations
*/
// Geekzu Public Service [Mirror]
mappings['sdn.geekzu.org'] = {
'/ajax/ajax/libs/': mappings['ajax.googleapis.com']['/ajax/libs/']
};
// USTC Linux User Group [Mirror]
mappings['ajax.proxy.ustclug.org'] = mappings['ajax.googleapis.com'];
/**
* Exports
*/
export default mappings;
/**
* Resource Sets
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-05-30 (originally "resources")
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* Public Constants
*/
const sets = {
// AngularJS
'angular': {
'path': 'resources/angularjs/{version}/angular.min.jsm',
'type': 'application/javascript'
},
// Backbone.js
'backbone': {
'path': 'resources/backbone.js/{version}/backbone-min.jsm',
'type': 'application/javascript'
},
// Dojo
'dojo': {
'path': 'resources/dojo/{version}/dojo/dojo.jsm',
'type': 'application/javascript'
},
// Ember.js
'ember': {
'path': 'resources/ember.js/{version}/ember.min.jsm',
'type': 'application/javascript'
},
// Ext Core
'extCore': {
'path': 'resources/ext-core/{version}/ext-core.jsm',
'type': 'application/javascript'
},
// jQuery
'jQuery': {
'path': 'resources/jquery/{version}/jquery.min.jsm',
'type': 'application/javascript'
},
// jQuery UI
'jQueryUI': {
'path': 'resources/jqueryui/{version}/jquery-ui.min.jsm',
'type': 'application/javascript'
},
// Modernizr
'modernizr': {
'path': 'resources/modernizr/{version}/modernizr.min.jsm',
'type': 'application/javascript'
},
// Moment.js
'moment': {
'path': 'resources/moment.js/{version}/moment.min.jsm',
'type': 'application/javascript'
},
// MooTools
'mootools': {
'path': 'resources/mootools/{version}/mootools-yui-compressed.jsm',
'type': 'application/javascript'
},
// Prototype
'prototypeJS': {
'path': 'resources/prototype/{version}/prototype.jsm',
'type': 'application/javascript'
},
// Scriptaculous
'scriptaculous': {
'path': 'resources/scriptaculous/{version}/scriptaculous.jsm',
'type': 'application/javascript'
},
// SWFObject
'swfobject': {
'path': 'resources/swfobject/{version}/swfobject.jsm',
'type': 'application/javascript'
},
// Underscore.js
'underscore': {
'path': 'resources/underscore.js/{version}/underscore-min.jsm',
'type': 'application/javascript'
},
// Web Font Loader
'webfont': {
'path': 'resources/webfont/{version}/webfont.jsm',
'type': 'application/javascript'
}
};
/**
* Exports
*/
export default sets;
/**
* Setting Defaults
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2024-10-10
* @license MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import Constants from '../constants.js';
/**
* Public Constants
*/
const defaults = {
[Constants.Setting.BLOCK_MISSING]: false,
[Constants.Setting.DISABLE_PREFETCH]: true,
[Constants.Setting.ENFORCE_STAGING]: false,
[Constants.Setting.SHOW_ICON_BADGE]: true,
[Constants.Setting.SHOW_RELEASE_NOTES]: true,
[Constants.Setting.STRIP_METADATA]: true,
[Constants.Setting.WHITELISTED_DOMAINS]: {},
[Constants.Setting.XHR_TEST_DOMAIN]: Constants.Address.DECENTRALEYES
};
/**
* Exports
*/
export default defaults;
/**
* Statistic Defaults
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2024-10-10
* @license MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import Constants from '../constants.js';
/**
* Public Constants
*/
const defaults = {
[Constants.Statistic.AMOUNT_INJECTED]: {
'value': 0, 'createdAt': new Date().toISOString()
},
[Constants.Statistic.AMOUNT_SANITIZED]: {
'value': 0, 'createdAt': new Date().toISOString()
},
[Constants.Statistic.AMOUNT_BLOCKED]: {
'value': 0, 'createdAt': new Date().toISOString()
}
};
/**
* Exports
*/
export default defaults;
...@@ -3,25 +3,14 @@ ...@@ -3,25 +3,14 @@
* Belongs to Decentraleyes. * Belongs to Decentraleyes.
* *
* @author Thomas Rientjes * @author Thomas Rientjes
* @since 2014-05-30 * @since 2016-04-04
* @license MPL 2.0 * @license MPL-2.0
* *
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. * You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
'use strict'; import './core/request/interceptor.js';
import './core/request/sanitizer.js';
/** import './utilities/messenger.js';
* Imports
*/
var Interceptor = require('./interceptor');
/**
* Main
*/
var interceptor = new Interceptor();
interceptor.register();
/**
* Background Helpers
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-10-26
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import Constants from '../data/constants.js';
import ResourceMappings from '../data/resource/mappings.js';
import Storage from '../core/storage.js';
/**
* Public Functions
*/
const normalizeDomain = (domain) => {
domain = domain.toLowerCase().trim().replace(/[^A-Za-z0-9.-]/g, '');
if (domain.startsWith(Constants.Address.WWW_PREFIX)) {
domain = domain.slice(Constants.Address.WWW_PREFIX.length);
}
return domain;
};
const domainIsWhitelisted = async (domain, whitelistedDomains = null) => {
if (domain !== null) {
if (! whitelistedDomains) {
whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
}
return Boolean(whitelistedDomains[domain]);
}
return false;
};
const updateWhitelistedDomains = async (whitelistedDomains) => {
await Storage.updateSetting(Constants.Setting.WHITELISTED_DOMAINS, whitelistedDomains);
};
const addDomainToWhitelist = async (domain) => {
const whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
whitelistedDomains[domain] = true;
await updateWhitelistedDomains(whitelistedDomains);
chrome.runtime.sendMessage({
'topic': 'domain:added-to-whitelist', 'value': whitelistedDomains
}, () => {
if (chrome.runtime.lastError) { /**/ }
});
};
const removeDomainFromWhitelist = async (domain) => {
const whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
delete whitelistedDomains[domain];
await updateWhitelistedDomains(whitelistedDomains);
chrome.runtime.sendMessage({
'topic': 'domain:removed-from-whitelist', 'value': whitelistedDomains
}, () => {
if (chrome.runtime.lastError) { /**/ }
});
};
const extractDomainFromUrl = (url, normalize = true) => {
let extractedDomain = null;
if (typeof url !== 'string') {
return null;
}
if (url.startsWith(Constants.Address.CHROME)) {
return null;
}
try {
extractedDomain = new URL(url).hostname;
} catch {
return null;
}
if (extractedDomain === '') {
return null;
}
if (normalize === true) {
extractedDomain = normalizeDomain(extractedDomain);
}
return extractedDomain;
};
const determineValidHosts = () => {
const validHosts = [];
for (const mapping of Object.keys(ResourceMappings)) {
const supportedHost = Constants.Address.ANY_PROTOCOL + mapping + Constants.Address.ANY_PATH;
validHosts.push(supportedHost);
}
return validHosts;
};
const setPrefetchDisabled = (disable) => {
if (disable === false) {
chrome.privacy.network.networkPredictionEnabled.clear({});
} else {
chrome.privacy.network.networkPredictionEnabled.set({'value': false});
}
};
const determineIconPaths = (type) => {
let sizes, iconPaths;
sizes = ['16', '18', '19', '32', '36', '38', '64'];
iconPaths = {};
for (const size of sizes) {
iconPaths[size] = chrome.runtime.getURL(`images/icons/action/${type}/${size}.png`);
}
return iconPaths;
};
/**
* Exports
*/
export default {
normalizeDomain,
domainIsWhitelisted,
updateWhitelistedDomains,
addDomainToWhitelist,
removeDomainFromWhitelist,
extractDomainFromUrl,
determineValidHosts,
setPrefetchDisabled,
determineIconPaths
};
/**
* Runtime Messenger
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2018-05-28
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import Constants from '../data/constants.js';
import Helpers from '../utilities/helpers.js';
import Storage from '../core/storage.js';
/**
* Private Functions
*/
const _handleMessageReceived = (message, sender, sendResponse) => {
let topic, value;
topic = message.topic;
value = message.value;
if (topic === 'extension:is-initialized') {
sendResponse({'value': true});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'tab-context:get') {
Storage.getTabContext(value).then((tabContext) => {
sendResponse({'value': tabContext});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'settings:get') {
Storage.getSettings(value?.concise).then((settings) => {
sendResponse({'value': settings});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'setting:update') {
Storage.updateSetting(value.key, value.value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'whitelisted-domains:update') {
Helpers.updateWhitelistedDomains(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'statistics:get-amount-injected') {
Storage.getStatistic(Constants.Statistic.AMOUNT_INJECTED).then((amountInjected) => {
sendResponse({'value': amountInjected});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:extract-from-url') {
sendResponse({'value': Helpers.extractDomainFromUrl(value)});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'domain:normalize') {
sendResponse({'value': Helpers.normalizeDomain(value)});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'domain:add-to-whitelist') {
Helpers.addDomainToWhitelist(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:remove-from-whitelist') {
Helpers.removeDomainFromWhitelist(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:is-whitelisted') {
Helpers.domainIsWhitelisted(value).then((domainIsWhitelisted) => {
sendResponse({'value': domainIsWhitelisted});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
};
/**
* Event Handlers
*/
chrome.runtime.onMessage.addListener(_handleMessageReceived);
/**
* Browser API Wrappers
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-12-03
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* Public Constants
*/
const action = {
setBadgeBackgroundColor (details) {
chrome.action.setBadgeBackgroundColor(details);
},
setBadgeText (details) {
chrome.action.setBadgeText(details);
},
setBadgeTextColor (details) {
if (chrome.action.setBadgeTextColor !== undefined) {
chrome.action.setBadgeTextColor(details);
}
},
setIcon (details) {
chrome.action.setIcon(details);
},
async setTitle (details) {
const platformInformation = await chrome.runtime.getPlatformInfo();
if (platformInformation.os !== chrome.runtime.PlatformOs.ANDROID) {
await chrome.action.setTitle(details);
}
}
};
/**
* Exports
*/
export default {
action
};
#
# API Configuration
#
"project_id" : "153483"
"base_url" : "https://api.crowdin.com"
#
# Directory Configuration
#
"preserve_hierarchy" : true
#
# File Configuration
#
files: [{
"source" : "/_locales/en_US/messages.json",
"translation" : "/_locales/%locale_with_underscore%/messages.json",
"export_only_approved" : true,
"languages_mapping" : {
"locale_with_underscore" : {
"ar" : "ar",
"bg" : "bg",
"bn" : "bn",
"ca" : "ca",
"cs" : "cs",
"da" : "da",
"de" : "de",
"el" : "el",
"eo" : "eo",
"es-ES" : "es",
"et" : "et",
"fi" : "fi",
"fr" : "fr",
"he" : "he",
"hr" : "hr",
"hu" : "hu",
"id" : "id",
"is" : "is",
"it" : "it",
"ja" : "ja",
"ko" : "ko",
"lb" : "lb",
"nb" : "nb",
"nl" : "nl",
"pa-IN" : "pa",
"pl" : "pl",
"ro" : "ro",
"ru" : "ru",
"si-LK" : "si",
"sq" : "sq",
"sr" : "sr",
"sv-SE" : "sv",
"tl" : "tl",
"tr" : "tr",
"uk" : "uk",
"vi" : "vi"
}
}
}]
INTRODUCTION
------------
This script (first introduced in Decentraleyes v1.1.5) should make reviewing this extension a lot easier than it used to be. It's open source and open for scrutiny, and it automatically compares the bundled libraries (resources) to their original sources (after removing any source mapping URLs).
FOR NON-LINUX USERS
-------------------
This usage guide is tailored to Linux based operating systems. If you're on a different type of system, the easiest direct solution might be to launch a free Linux box with Node.js pre-installed on Red Hat OpenShift. You can then SSH into it (after adding your own machine's public key to your account).
Having said that, every terminal command in the usage guide below comes with a description, so it should not be too hard to get this done on practically any type of configuration.
USAGE INSTRUCTIONS
------------------
1. Make sure you have Node.js installed on your machine (or install it).
2. Open up a terminal and 'cd' into this directory.
Description: Navigate to this directory.
3. Execute 'rm -r ./node_modules; npm install' to ensure dependency integrity.
Description: Remove the node modules folder and reinstall dependencies using npm.
Note: If this fails, compare dependency file hashes and leave the folder in place.
4. Run the audit script by executing 'node run'.
Description: Run the script through Node.js and view the output.
Note: If you'd like to store the report, run 'node run > report.txt'.
Note description: It's possible to write the console output to a file.
{
"bitwise": true,
"camelcase": true,
"curly": false,
"eqeqeq": true,
"es3": true,
"forin": true,
"immed": false,
"indent": false,
"latedef": "nofunc",
"newcap": false,
"noarg": true,
"noempty": true,
"nonew": false,
"plusplus": false,
"quotmark": false,
"undef": true,
"unused": "vars",
"strict": false,
"trailing": true,
"maxparams": 5,
"maxdepth": false,
"maxstatements": false,
"maxcomplexity": false,
"maxlen": 100,
"asi": true,
"expr": true,
"globalstrict": true,
"smarttabs": true,
"sub": true,
"node": true,
"globals": {
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
"afterEach": false,
"define": false
}
}
The MIT License (MIT)
Copyright (c) 2014 Simon Lydell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "source-map-url",
"version": "0.4.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "Tools for working with sourceMappingURL comments.",
"keywords": [
"source map",
"sourceMappingURL",
"comment",
"annotation"
],
"main": "source-map-url.js",
"authors": [
"Simon Lydell"
],
"ignore": [
".*"
]
}
\ No newline at end of file
### Version 0.4.0 (2015-11-12) ###
- Changed: sourceMappingURL comments used to be matched only when placed at
the end of the script. However, since several commonly used JavaScript
libraries do not follow this convention and all popular web browsers accept
non-trailing comments, this has been revised.
So now non-trailing SourceMappingURL comments are matched as well.
### Version 0.3.0 (2014-08-16) ###
- Changed: sourceMappingURL comments used to be matched only if they appeared
on their own line. However, the spec only says:
> The generated code may include a line at the end of the source, with the following form:
>
> //# sourceMappingURL=<url>
So now they are matched also when they appear on the same line as code.
- Removed: The `.set()` method. I couldn’t decide how it should work
considering the above change. Moreover, it was unnecessarily complex (and
would have gotten worse) for very little gain. It is much easier to run
`.remove()` if needed, and then simply `code += "\n//# sourceMappingURL=" +
url` (using the appropriate comment syntax and newline). KISS.
- Changed: The `.insertBefore()` method now always inserts the string exactly
before the sourceMappingURL comment; not before the newline before the
comment (if any). Moreover, it does not ensure that the comment will be on a
new line anymore. This is up to the caller. KISS.
- Changed: The `.remove()` method no longer removes the newline before the
sourceMappingURL (if any).
- Changed: Renamed `.get()` to `.getFrom()`.
- Changed: Renamed `.remove()` to `.removeFrom()`.
- Added: The `.existsIn()` method.
### Version 0.2.0 (2014-02-23) ###
- Changed: A space is no longer inserted before the closing comment syntax. If
such a space is desired, it needs to be put in the closing comment syntax
itself (such as `["/*", " */"]` instead of `["/*", "*/"]`). (Backwards
incompatible change.)
### Version 0.1.0 (2014-02-22) ###
- Initial release.
{
"name": "source-map-url",
"version": "0.4.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "Tools for working with sourceMappingURL comments.",
"keywords": [
"source map",
"sourceMappingURL",
"comment",
"annotation"
],
"main": "source-map-url.js",
"repo": "lydell/source-map-url",
"scripts": [
"source-map-url.js"
]
}
{
"name": "source-map-url",
"version": "0.4.0",
"author": {
"name": "Simon Lydell"
},
"license": "MIT",
"description": "Tools for working with sourceMappingURL comments.",
"keywords": [
"source map",
"sourceMappingURL",
"comment",
"annotation"
],
"main": "source-map-url.js",
"repository": {
"type": "git",
"url": "git://github.com/lydell/source-map-url"
},
"scripts": {
"lint": "jshint source-map-url.js test/ ",
"unit": "mocha",
"test": "npm run lint && npm run unit"
},
"devDependencies": {
"mocha": "~1.17.1",
"expect.js": "~0.3.1",
"jshint": "~2.4.3"
},
"testling": {
"harness": "mocha",
"files": "test/*.js",
"browsers": [
"ie/8..latest",
"chrome/latest",
"firefox/latest",
"opera/12",
"opera/latest",
"safari/5",
"iphone/6",
"android-browser/4"
]
},
"readme": "Overview [![Build Status](https://travis-ci.org/lydell/source-map-url.png?branch=master)](https://travis-ci.org/lydell/source-map-url)\n========\n\n[![browser support](https://ci.testling.com/lydell/source-map-url.png)](https://ci.testling.com/lydell/source-map-url)\n\nTools for working with sourceMappingURL comments.\n\n```js\nvar sourceMappingURL = require(\"source-map-url\")\n\nvar code = [\n \"!function(){...}();\",\n \"/*# sourceMappingURL=foo.js.map */\"\n].join(\"\\n\")\n\nsourceMappingURL.existsIn(code)\n// true\n\nsourceMappingURL.getFrom(code)\n// foo.js.map\n\ncode = sourceMappingURL.insertBefore(code, \"// License: MIT\\n\")\n// !function(){...}();\n// // License: MIT\n// /*# sourceMappingURL=foo.js.map */\n\ncode = sourceMappingURL.removeFrom(code)\n// !function(){...}();\n// // License: MIT\n\nsourceMappingURL.existsIn(code)\n// false\n\nsourceMappingURL.getFrom(code)\n// null\n\ncode += \"//# sourceMappingURL=/other/file.js.map\"\n// !function(){...}();\n// // License: MIT\n// //# sourceMappingURL=/other/file.js.map\n```\n\n\nInstallation\n============\n\n- `npm install source-map-url`\n- `bower install source-map-url`\n- `component install lydell/source-map-url`\n\nWorks with CommonJS, AMD and browser globals, through UMD.\n\n\nUsage\n=====\n\n### `sourceMappingURL.getFrom(code)` ###\n\nReturns the url of the sourceMappingURL comment in `code`. Returns `null` if\nthere is no such comment.\n\n### `sourceMappingURL.existsIn(code)` ###\n\nReturns `true` if there is a sourceMappingURL comment in `code`, or `false`\notherwise.\n\n### `sourceMappingURL.removeFrom(code)` ###\n\nRemoves the sourceMappingURL comment in `code`. Does nothing if there is no\nsuch comment. Returns the updated `code`.\n\n### `sourceMappingURL.insertBefore(code, string)` ###\n\nInserts `string` before the sourceMappingURL comment in `code`. Appends\n`string` to `code` if there is no such comment.\n\nLets you append something to a file without worrying about burying the\nsourceMappingURL comment (by keeping it at the end of the file).\n\n### `sourceMappingURL.regex` ###\n\nThe regex that is used to match sourceMappingURL comments. It matches both `//`\nand `/**/` comments, thus supporting both JavaScript and CSS.\n\n\nTests\n=====\n\nStart by running `npm test`, which lints the code and runs the test suite in Node.js.\n\nTo run the tests in a browser, run `testling` (`npm install -g testling`) or `testling -u`.\n\n\nLicense\n=======\n\n[The X11 (“MIT”) License](LICENSE).\n",
"readmeFilename": "readme.md",
"bugs": {
"url": "https://github.com/lydell/source-map-url/issues"
},
"_id": "source-map-url@0.4.0",
"dist": {
"shasum": "dd535e941e3363ba6841833731f56ca4448b8713"
},
"_from": "source-map-url@~0.4.0",
"_resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz"
}
Overview [![Build Status](https://travis-ci.org/lydell/source-map-url.png?branch=master)](https://travis-ci.org/lydell/source-map-url)
========
[![browser support](https://ci.testling.com/lydell/source-map-url.png)](https://ci.testling.com/lydell/source-map-url)
Tools for working with sourceMappingURL comments.
```js
var sourceMappingURL = require("source-map-url")
var code = [
"!function(){...}();",
"/*# sourceMappingURL=foo.js.map */"
].join("\n")
sourceMappingURL.existsIn(code)
// true
sourceMappingURL.getFrom(code)
// foo.js.map
code = sourceMappingURL.insertBefore(code, "// License: MIT\n")
// !function(){...}();
// // License: MIT
// /*# sourceMappingURL=foo.js.map */
code = sourceMappingURL.removeFrom(code)
// !function(){...}();
// // License: MIT
sourceMappingURL.existsIn(code)
// false
sourceMappingURL.getFrom(code)
// null
code += "//# sourceMappingURL=/other/file.js.map"
// !function(){...}();
// // License: MIT
// //# sourceMappingURL=/other/file.js.map
```
Installation
============
- `npm install source-map-url`
- `bower install source-map-url`
- `component install lydell/source-map-url`
Works with CommonJS, AMD and browser globals, through UMD.
Usage
=====
### `sourceMappingURL.getFrom(code)` ###
Returns the url of the sourceMappingURL comment in `code`. Returns `null` if
there is no such comment.
### `sourceMappingURL.existsIn(code)` ###
Returns `true` if there is a sourceMappingURL comment in `code`, or `false`
otherwise.
### `sourceMappingURL.removeFrom(code)` ###
Removes the sourceMappingURL comment in `code`. Does nothing if there is no
such comment. Returns the updated `code`.
### `sourceMappingURL.insertBefore(code, string)` ###
Inserts `string` before the sourceMappingURL comment in `code`. Appends
`string` to `code` if there is no such comment.
Lets you append something to a file without worrying about burying the
sourceMappingURL comment (by keeping it at the end of the file).
### `sourceMappingURL.regex` ###
The regex that is used to match sourceMappingURL comments. It matches both `//`
and `/**/` comments, thus supporting both JavaScript and CSS.
Tests
=====
Start by running `npm test`, which lints the code and runs the test suite in Node.js.
To run the tests in a browser, run `testling` (`npm install -g testling`) or `testling -u`.
License
=======
[The X11 (“MIT”) License](LICENSE).
// Copyright 2014 Simon Lydell
// X11 (“MIT”) Licensed. (See LICENSE.)
void (function(root, factory) {
if (typeof define === "function" && define.amd) {
define(factory)
} else if (typeof exports === "object") {
module.exports = factory()
} else {
root.sourceMappingURL = factory()
}
}(this, function() {
var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/
var regex = RegExp(
"(?:" +
"/\\*" +
"(?:\\s*\r?\n(?://)?)?" +
"(?:" + innerRegex.source + ")" +
"\\s*" +
"\\*/" +
"|" +
"//(?:" + innerRegex.source + ")" +
")" +
"\\s*"
)
return {
regex: regex,
_innerRegex: innerRegex,
getFrom: function(code) {
var match = code.match(regex)
return (match ? match[1] || match[2] || "" : null)
},
existsIn: function(code) {
return regex.test(code)
},
removeFrom: function(code) {
return code.replace(regex, "")
},
insertBefore: function(code, string) {
var match = code.match(regex)
if (match) {
return code.slice(0, match.index) + string + code.slice(match.index)
} else {
return code + string
}
}
}
}));
// Copyright 2014 Simon Lydell
// X11 (“MIT”) Licensed. (See LICENSE.)
var expect = require("expect.js")
var sourceMappingURL = require("../")
var comments = {
universal: [
"/*# sourceMappingURL=foo.js.map */"
],
js: [
"//# sourceMappingURL=foo.js.map"
],
block: [
"/*",
"# sourceMappingURL=foo.js.map",
"*/"
],
mix: [
"/*",
"//# sourceMappingURL=foo.js.map",
"*/"
]
}
var nonTrailingComments = {
jsLeading: {
contents: [
"//# sourceMappingURL=foo.js.map",
"(function(){})"
],
solution: [
"(function(){})"
]
},
mixEmbedded: {
contents: [
"/*! Library Name v1.0.0",
"//# sourceMappingURL=foo.js.map",
"*/",
"(function(){})"
],
solution: [
"/*! Library Name v1.0.0",
"*/",
"(function(){})"
]
}
}
function forEachComment(fn) {
forOf(comments, function(name, comment) {
var description = "the '" + name + "' syntax with "
fn(comment.join("\n"), description + "regular newlines")
fn(comment.join("\r\n"), description + "Windows newlines")
})
}
function forEachNonTrailingComment(fn) {
forOf(nonTrailingComments, function(name, comment) {
var description = "the '" + name + "' syntax with "
fn({
contents: comment.contents.join("\n"),
solution: comment.solution.join("\n")
}, description + "regular newlines")
fn({
contents: comment.contents.join("\r\n"),
solution: comment.solution.join("\r\n")
}, description + "Windows newlines")
})
}
function forOf(obj, fn) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn(key, obj[key])
}
}
}
describe("sourceMappingURL", function() {
describe(".getFrom", function() {
forEachComment(function(comment, description) {
it("gets the url from " + description, function() {
expect(sourceMappingURL.getFrom("code\n" + comment))
.to.equal("foo.js.map")
expect(sourceMappingURL.getFrom("code" + comment))
.to.equal("foo.js.map")
expect(sourceMappingURL.getFrom(comment))
.to.equal("foo.js.map")
})
})
forEachNonTrailingComment(function(comment, description) {
it("gets the url from " + description, function() {
expect(sourceMappingURL.getFrom("code\n" + comment.contents))
.to.equal("foo.js.map")
expect(sourceMappingURL.getFrom("code" + comment.contents))
.to.equal("foo.js.map")
expect(sourceMappingURL.getFrom(comment.contents))
.to.equal("foo.js.map")
})
})
it("returns null if no comment", function() {
expect(sourceMappingURL.getFrom("code"))
.to.equal(null)
})
it("can return an empty string as url", function() {
expect(sourceMappingURL.getFrom("/*# sourceMappingURL= */"))
.to.equal("")
})
it("is detachable", function() {
var get = sourceMappingURL.getFrom
expect(get("/*# sourceMappingURL=foo */"))
.to.equal("foo")
})
})
describe(".existsIn", function() {
forEachComment(function(comment, description) {
it("returns true for " + description, function() {
expect(sourceMappingURL.existsIn("code\n" + comment))
.to.equal(true)
expect(sourceMappingURL.existsIn("code" + comment))
.to.equal(true)
expect(sourceMappingURL.existsIn(comment))
.to.equal(true)
})
})
forEachNonTrailingComment(function(comment, description) {
it("returns true for " + description, function() {
expect(sourceMappingURL.existsIn("code\n" + comment.contents))
.to.equal(true)
expect(sourceMappingURL.existsIn("code" + comment.contents))
.to.equal(true)
expect(sourceMappingURL.existsIn(comment.contents))
.to.equal(true)
})
})
it("returns false if no comment", function() {
expect(sourceMappingURL.existsIn("code"))
.to.equal(false)
})
it("is detachable", function() {
var has = sourceMappingURL.existsIn
expect(has("/*# sourceMappingURL=foo */"))
.to.equal(true)
})
})
describe(".removeFrom", function() {
forEachComment(function(comment, description) {
it("removes the comment for " + description, function() {
expect(sourceMappingURL.removeFrom("code\n" + comment))
.to.equal("code\n")
expect(sourceMappingURL.removeFrom("code" + comment))
.to.equal("code")
expect(sourceMappingURL.removeFrom(comment))
.to.equal("")
})
})
forEachNonTrailingComment(function(comment, description) {
it("removes the comment for " + description, function() {
expect(sourceMappingURL.removeFrom("code\n" + comment.contents))
.to.equal("code\n" + comment.solution)
expect(sourceMappingURL.removeFrom("code" + comment.contents))
.to.equal("code" + comment.solution)
expect(sourceMappingURL.removeFrom(comment.contents))
.to.equal(comment.solution)
})
})
it("does nothing if no comment", function() {
expect(sourceMappingURL.removeFrom("code\n"))
.to.equal("code\n")
})
it("is detachable", function() {
var remove = sourceMappingURL.removeFrom
expect(remove("/*# sourceMappingURL=foo */"))
.to.equal("")
})
})
describe(".insertBefore", function() {
forEachComment(function(comment, description) {
it("inserts a string before the comment for " + description, function() {
expect(sourceMappingURL.insertBefore("code\n" + comment, "more code\n"))
.to.equal("code\nmore code\n" + comment)
expect(sourceMappingURL.insertBefore("code" + comment, "\nmore code"))
.to.equal("code\nmore code" + comment)
expect(sourceMappingURL.insertBefore(comment, "some code"))
.to.equal("some code" + comment)
})
})
it("inserts a string before an embedded comment", function() {
expect(sourceMappingURL.insertBefore("/*! Library Name v1.0.0\n" +
"//# sourceMappingURL=foo.js.map\n*/\n(function(){})", "code\n"))
.to.equal("/*! Library Name v1.0.0\ncode\n" +
"//# sourceMappingURL=foo.js.map\n*/\n(function(){})")
})
it("inserts a string before a leading comment", function() {
expect(sourceMappingURL.insertBefore("//# sourceMappingURL=foo.js.map\n" +
"(function(){})", "code\n"))
.to.equal("code\n//# sourceMappingURL=foo.js.map\n" +
"(function(){})")
})
it("appends if no comment", function() {
expect(sourceMappingURL.insertBefore("code", "\nmore code"))
.to.equal("code\nmore code")
})
it("is detachable", function() {
var insertBefore = sourceMappingURL.insertBefore
expect(insertBefore("/*# sourceMappingURL=foo */", "bar"))
.to.equal("bar/*# sourceMappingURL=foo */")
})
})
describe(".regex", function() {
it("includes ._innerRegex", function() {
expect(sourceMappingURL.regex.source)
.to.contain(sourceMappingURL._innerRegex.source)
})
var match = function(code) {
expect(code)
.to.match(sourceMappingURL.regex)
}
var noMatch = function(code) {
expect(code)
.not.to.match(sourceMappingURL.regex)
}
forEachComment(function(comment, description) {
it("matches " + description, function() {
match("code\n" + comment)
match("code" + comment)
match(comment)
})
it("matches " + description + ", with trailing whitespace", function() {
match(comment + " ")
match(comment + "\n")
match(comment + "\n\n\t\n \t ")
})
})
it("does not match some cases that are easy to mess up", function() {
noMatch(
"/* # sourceMappingURL=foo */"
)
noMatch(
"// # sourceMappingURL=foo"
)
})
it("is liberal regarding inner whitespace", function() {
match(
"/*# sourceMappingURL=foo*/"
)
match(
"/*# sourceMappingURL=foo */"
)
match(
"/*# sourceMappingURL=foo \t\n" +
"*/"
)
match(
"/* \n" +
"# sourceMappingURL=foo\n" +
"*/"
)
match(
"/*\n" +
"# sourceMappingURL=foo\n" +
" */"
)
match(
"/*\n" +
"# sourceMappingURL=foo\n" +
"\n" +
"\t\n" +
"*/"
)
})
})
describe("._innerRegex", function() {
it("matches the contents of sourceMappingURL comments", function() {
expect("# sourceMappingURL=http://www.example.com/foo/bar.js.map")
.to.match(sourceMappingURL._innerRegex)
})
it("captures the url in the first capture group", function() {
expect(sourceMappingURL._innerRegex.exec("# sourceMappingURL=foo")[1])
.to.equal("foo")
})
it("supports the legacy syntax", function() {
expect("@ sourceMappingURL=http://www.example.com/foo/bar.js.map")
.to.match(sourceMappingURL._innerRegex)
})
})
})