mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
9711c67c3f
commit
26529a3653
6 changed files with 375 additions and 281 deletions
32
lib/modifiedAPIFunctions.js
Normal file
32
lib/modifiedAPIFunctions.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* 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";
|
||||
|
||||
var scope;
|
||||
if ((typeof exports) !== "undefined"){
|
||||
scope = exports;
|
||||
}
|
||||
else {
|
||||
window.scope.modifiedAPIFunctions = {};
|
||||
scope = window.scope.modifiedAPIFunctions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
scope.hasType = function hasType(status, type){
|
||||
return status.type.indexOf(type) !== -1;
|
||||
};
|
||||
|
||||
scope.checkerWrapper = function checkerWrapper(checker, object, args, callback){
|
||||
const check = checker();
|
||||
if (check.allow){
|
||||
if (check.allow === true){
|
||||
return check.original.apply(object, check.window.Array.from(args));
|
||||
}
|
||||
return callback.call(object, args, check);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue