Skip to content

Commit

Permalink
Remove window.PerformanceEntry wrapping
Browse files Browse the repository at this point in the history
In reality it was PerformanceEntry.startTime and
PerformanceEntry.duration wrapping, see #57.

Testing page https://www.fit.vutbr.cz/~ipolcak/firefox_csp_bug/nocsp.php
is not influenced by the wrapping. It is unclear when is the wrapping
applied.
  • Loading branch information
polcak committed Jun 12, 2020
1 parent 8bfb9d3 commit fc25314
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
1 change: 0 additions & 1 deletion common/levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ var wrapping_groups = {
wrappers: [
// HRT
"Performance.prototype.now",
"window.PerformanceEntry",
// PT2
"performance.getEntries",
"performance.getEntriesByName",
Expand Down
29 changes: 0 additions & 29 deletions common/wrappingS-HRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@
* Create private namespace
*/
(function() {
function changePropertyPrototype(name) {
let descriptor = Object.getOwnPropertyDescriptor(PerformanceEntry.prototype, name);
let originalF = descriptor['get'];
let replacementF = function() {
let originalVal = originalF.call(this, ...arguments);
return func(originalVal, precision);
// Replace this when injecting, to differ between startTime and duration functions
'__name__';
};
descriptor['get'] = replacementF;
original_functions[replacementF.toString()] = originalF.toString();
Object.defineProperty(PerformanceEntry.prototype, name, descriptor);
}

var wrappers = [
{
parent_object: "Performance.prototype",
Expand Down Expand Up @@ -68,21 +54,6 @@
return func(originalPerformanceValue, precision);
`
},
{
parent_object: "window",
parent_object_property: "PerformanceEntry",
wrapped_objects: [],
helping_code: rounding_function + noise_function + `
let precision = args[0];
let doNoise = args[1];
var func = rounding_function;
if (doNoise === true){
func = noise_function
}
(${changePropertyPrototype.toString().split("__name__").join('"startTime"')})('startTime');
(${changePropertyPrototype.toString().split("__name__").join('"duration"')})('duration');
`
}
];
add_wrappers(wrappers);
})();

0 comments on commit fc25314

Please sign in to comment.