OntoZoo / ontobee

Ontobee is a linked data server for ontologies. See: http://www.ontobee.org.
27 stars 5 forks source link

Ontobee is presenting some javascript code at the top of term pages #153

Closed alanruttenberg closed 4 years ago

alanruttenberg commented 4 years ago

I'm seeing this, or something like it, at the top of each term page I view. e.g http://www.ontobee.org/ontology/FIX?iri=http://purl.obolibrary.org/obo/fix%23BY

(function () { const context = { "BUFFER": null, "getChannelData": function (e) { const getChannelData = e.prototype.getChannelData; Object.defineProperty(e.prototype, "getChannelData", { "value": function () { const results_1 = getChannelData.apply(this, arguments); if (context.BUFFER !== results_1) { context.BUFFER = results_1; window.top.postMessage("audiocontext-fingerprint-defender-alert", ''); for (var i = 0; i < results_1.length; i += 100) { let index = Math.floor(Math.random() i); results_1[index] = results_1[index] + Math.random() 0.0000001; } } // return results_1; } }); }, "createAnalyser": function (e) { const createAnalyser = e.prototype.proto.createAnalyser; Object.defineProperty(e.prototype.proto, "createAnalyser", { "value": function () { const results_2 = createAnalyser.apply(this, arguments); const getFloatFrequencyData = results_2.proto.getFloatFrequencyData; Object.defineProperty(results_2.proto, "getFloatFrequencyData", { "value": function () { window.top.postMessage("audiocontext-fingerprint-defender-alert", ''); const results_3 = getFloatFrequencyData.apply(this, arguments); for (var i = 0; i < arguments[0].length; i += 100) { let index = Math.floor(Math.random() i); arguments[0][index] = arguments[0][index] + Math.random() 0.1; } // return results_3; } }); // return results_2; } }); } }; // context.getChannelData(AudioBuffer); context.createAnalyser(AudioContext); context.getChannelData(OfflineAudioContext); context.createAnalyser(OfflineAudioContext); document.documentElement.dataset.acxscriptallow = true; })(){ const iframes = window.top.document.querySelectorAll("iframe[sandbox]"); for (var i = 0; i < iframes.length; i++) { if (iframes[i].contentWindow) { if (iframes[i].contentWindow.AudioBuffer) { if (iframes[i].contentWindow.AudioBuffer.prototype) { if (iframes[i].contentWindow.AudioBuffer.prototype.getChannelData) { iframes[i].contentWindow.AudioBuffer.prototype.getChannelData = AudioBuffer.prototype.getChannelData; } } } if (iframes[i].contentWindow.AudioContext) { if (iframes[i].contentWindow.AudioContext.prototype) { if (iframes[i].contentWindow.AudioContext.prototype.proto) { if (iframes[i].contentWindow.AudioContext.prototype.proto.createAnalyser) { iframes[i].contentWindow.AudioContext.prototype.proto.createAnalyser = AudioContext.prototype.proto.createAnalyser; } } } } if (iframes[i].contentWindow.OfflineAudioContext) { if (iframes[i].contentWindow.OfflineAudioContext.prototype) { if (iframes[i].contentWindow.OfflineAudioContext.prototype.proto) { if (iframes[i].contentWindow.OfflineAudioContext.prototype.proto.createAnalyser) { iframes[i].contentWindow.OfflineAudioContext.prototype.proto.createAnalyser = OfflineAudioContext.prototype.proto.createAnalyser; } } } } if (iframes[i].contentWindow.OfflineAudioContext) { if (iframes[i].contentWindow.OfflineAudioContext.prototype) { if (iframes[i].contentWindow.OfflineAudioContext.prototype.proto) { if (iframes[i].contentWindow.OfflineAudioContext.prototype.proto.getChannelData) { iframes[i].contentWindow.OfflineAudioContext.prototype.proto.getChannelData = OfflineAudioContext.prototype.proto.getChannelData; } } } } } } }

e4ong1031 commented 4 years ago

Hi @alanruttenberg ,

I tested the URL on Linux (Chrome & Firefox), Mac (Chrome, Firefox & Safari) and Windows (Chrome, Firefox & IE) and could not reproduce the issue you have. Could you tell me what OS and browser you are using?

Thanks

alanruttenberg commented 4 years ago

I have observed it in Macos in Firefox and Chromium and in Android in Firefox

alanruttenberg commented 4 years ago

I tracked it down to an extension - AudioContext Fingerprint Defender Apparently it is injecting a script element into pages, but inserted into the xsl, it breaks. I've disabled it,