xzfc / agar-expose

Yet another ogar client
12 stars 12 forks source link

Not working with extensions #20

Closed SrNicolas closed 8 years ago

SrNicolas commented 8 years ago

Ifk if it's me por This conde Can't work with extensions, because I tried and got no luck making this work IN A Google chrome extenaion

mbm3 commented 8 years ago

It's easy

SrNicolas commented 8 years ago

wan't to help? cuz I just cant get it to work

HackMeThat commented 8 years ago

// manifest.json { "manifest_version": 2, "name": "Expose", "version": "0.1", "browser_action": { "default_title": "Expose" }, "content_scripts": [ { "matches": ["http://agar.io/*"], "js": ["content.js" ], "run_at": "document_start" } ], "web_accessible_resources": [ "expose.js"] }

//expose.js

(function() {

// Paste https://github.com/xzfc/agar-expose/blob/master/expose.user.js code here

window.onerror = function(msg) {
if(msg=='Uncaught TypeError: window.setGameMode is not a function'){window.location.reload();}
    return true;
}
}())

// content.js var s = document.createElement('script'); s.src = chrome.extension.getURL('expose.js'); s.onload = function() { this.parentNode.removeChild(this); }; (document.head||document.documentElement).appendChild(s);