2015-09-06 12:26:50 +02:00
|
|
|
/* 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/. */
|
|
|
|
(function(){
|
|
|
|
"use strict";
|
|
|
|
|
2019-11-28 01:26:35 +01:00
|
|
|
let scope;
|
2017-06-25 22:33:12 +02:00
|
|
|
if ((typeof exports) !== "undefined"){
|
|
|
|
scope = exports;
|
|
|
|
}
|
|
|
|
else {
|
2019-03-12 22:24:23 +01:00
|
|
|
scope = require.register("./modifiedAPI", {});
|
2017-06-25 22:33:12 +02:00
|
|
|
}
|
|
|
|
|
2019-03-13 08:08:36 +01:00
|
|
|
const randomSupplyCallbacks = [];
|
2017-06-25 22:33:12 +02:00
|
|
|
scope.setRandomSupply = function(supply){
|
2019-03-13 08:08:36 +01:00
|
|
|
randomSupplyCallbacks.forEach(function(callback){
|
|
|
|
callback(supply);
|
|
|
|
});
|
2015-09-06 12:26:50 +02:00
|
|
|
};
|
2019-03-13 08:08:36 +01:00
|
|
|
scope.changedFunctions = {};
|
2018-07-13 16:58:13 +02:00
|
|
|
|
2018-08-27 00:23:19 +02:00
|
|
|
scope.changedGetters = [];
|
2018-07-13 16:58:13 +02:00
|
|
|
|
|
|
|
function appendModified(collection){
|
2019-03-13 08:08:36 +01:00
|
|
|
if (collection.setRandomSupply){
|
|
|
|
randomSupplyCallbacks.push(collection.setRandomSupply);
|
|
|
|
}
|
2018-07-13 16:58:13 +02:00
|
|
|
Object.keys(collection.changedFunctions || {}).forEach(function(key){
|
|
|
|
scope.changedFunctions[key] = collection.changedFunctions[key];
|
|
|
|
});
|
|
|
|
|
2018-08-27 00:23:19 +02:00
|
|
|
(collection.changedGetters || []).forEach(function(changedGetter){
|
|
|
|
scope.changedGetters.push(changedGetter);
|
2018-07-13 16:58:13 +02:00
|
|
|
});
|
|
|
|
}
|
2019-03-13 08:08:36 +01:00
|
|
|
appendModified(require("./modifiedCanvasAPI"));
|
|
|
|
appendModified(require("./modifiedAudioAPI"));
|
2018-08-27 00:30:48 +02:00
|
|
|
appendModified(require("./modifiedHistoryAPI"));
|
2018-08-27 00:33:39 +02:00
|
|
|
appendModified(require("./modifiedWindowAPI"));
|
2019-03-13 08:08:36 +01:00
|
|
|
appendModified(require("./modifiedDOMRectAPI"));
|
2019-02-27 23:49:00 +01:00
|
|
|
appendModified(require("./modifiedNavigatorAPI"));
|
2019-11-11 23:00:39 +01:00
|
|
|
appendModified(require("./modifiedScreenAPI"));
|
2015-09-06 12:26:50 +02:00
|
|
|
}());
|