Skip to content

Instantly share code, notes, and snippets.

@xnonn
Created November 3, 2012 13:07
Show Gist options
  • Save xnonn/4007350 to your computer and use it in GitHub Desktop.
Save xnonn/4007350 to your computer and use it in GitHub Desktop.
Patch for UserScriptLoader.uc.js
--- UserScriptLoader.uc.js.orig 2012-08-31 03:20:30.000000000 +0900
+++ UserScriptLoader.uc.js 2012-08-31 03:20:50.000000000 +0900
@@ -254,6 +254,14 @@
['onload','onerror','onreadystatechange'].forEach(function(k) {
if(obj[k] && (typeof(obj[k]) == 'function' || obj[k] instanceof Function)) req[k] = function() {
obj[k]({
+ __exposedProps__: {
+ status: "r",
+ statusText: "r",
+ responseHeaders: "r",
+ responseText: "rw",
+ readyState: "r",
+ finalUrl: "r"
+ },
status : (req.readyState == 4) ? req.status : 0,
statusText : (req.readyState == 4) ? req.statusText : '',
responseHeaders : (req.readyState == 4) ? req.getAllResponseHeaders() : '',
@@ -854,6 +862,9 @@
USL.reloadScripts();
var winObj = {
+ __exposedProps__ : {
+ __proto__: "r"
+ },
window: safeWindow,
get AutoPagerize() {
return this.window.AutoPagerize;
@@ -885,7 +896,7 @@
}
});
if (documentEnds.length) {
- aDocument.addEventListener("DOMContentLoaded", function(event){
+ safeWindow.addEventListener("DOMContentLoaded", function(event){
event.currentTarget.removeEventListener(event.type, arguments.callee, false);
documentEnds.forEach(function(s) "delay" in s ?
safeWindow.setTimeout(run, s.delay, s) : run(s));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment