Fixed Issues #153 and #158. Thanks to @Pantalaim0n and @CrackedP0t for the suggestion with the use of unsafeWindow but I rather use @cpeter256 version with window.eval instead.

This commit is contained in:
Aktanusa
2018-03-04 18:15:32 -05:00
parent 67eac9fde2
commit 71388411b5

View File

@@ -81,14 +81,16 @@ If you'd rather use the addon as a script via per example *Greasemonkey* or *Tam
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
(function() { var code = "(" + (function() {
var checkReady = setInterval(function() { var checkReady = setInterval(function() {
if (typeof Game.ready !== 'undefined' && Game.ready) { if (typeof Game.ready !== 'undefined' && Game.ready) {
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js'); Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
clearInterval(checkReady); clearInterval(checkReady);
} }
}, 1000); }, 1000);
})(); }).toString() + ")()";
window.eval(code);
``` ```
If you are using the beta, use this instead: If you are using the beta, use this instead:
@@ -101,14 +103,16 @@ If you are using the beta, use this instead:
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
(function() { var code = "(" + (function() {
var checkReady = setInterval(function() { var checkReady = setInterval(function() {
if (typeof Game.ready !== 'undefined' && Game.ready) { if (typeof Game.ready !== 'undefined' && Game.ready) {
Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js'); Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonsterBeta.js');
clearInterval(checkReady); clearInterval(checkReady);
} }
}, 1000); }, 1000);
})(); }).toString() + ")()";
window.eval(code);
``` ```
# Bugs and suggestions # Bugs and suggestions