1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00
This commit is contained in:
kkapsner 2019-01-24 15:43:20 +01:00
parent 1dc9b50242
commit f38e55b538
4 changed files with 33 additions and 23 deletions

View file

@ -13,7 +13,7 @@
scope = window.scope.modifiedDOMRectAPI;
}
const {checkerWrapper} = require("./modifiedAPIFunctions");
const {checkerWrapper, setProperties: setProperties} = require("./modifiedAPIFunctions");
const {byteArrayToString: hash} = require("./hash");
const getWrapped = require("sdk/getWrapped");
@ -89,9 +89,6 @@
scope.changedFunctions = {
getClientRects: {
type: "readout",
api: "domRect",
getStatus: getStatus,
object: ["Range", "Element"],
fakeGenerator: function(checker){
return function getClientRects(){
@ -107,9 +104,6 @@
}
},
getBoundingClientRect: {
type: "readout",
api: "domRect",
getStatus: getStatus,
object: ["Range", "Element"],
fakeGenerator: function(checker){
return function getBoundingClientRect(){
@ -124,9 +118,6 @@
}
},
getBounds: {
type: "readout",
api: "domRect",
getStatus: getStatus,
object: ["DOMQuad"],
fakeGenerator: function(checker){
return function getBounds(){
@ -140,9 +131,6 @@
}
},
getBBox: {
type: "readout",
api: "domRect",
getStatus: getStatus,
object: ["SVGGraphicsElement"],
fakeGenerator: function(checker){
return function getBBox(){
@ -156,9 +144,6 @@
}
},
getExtentOfChar: {
type: "readout",
api: "domRect",
getStatus: getStatus,
object: ["SVGTextContentElement"],
fakeGenerator: function(checker){
return function getBBox(){
@ -421,16 +406,15 @@
}
];
function getStatus(obj, status, prefs){
status = Object.create(status);
status.active = prefs("protectDOMRect", status.url);
return status;
}
scope.changedGetters.forEach(function(changedGetter){
changedGetter.type = "readout";
changedGetter.getStatus = getStatus;
changedGetter.api = "domRect";
setProperties(scope.changedFunctions, scope.changedGetters, {
type: "readout",
getStatus: getStatus,
api: "domRect"
});
}());