Compare commits

...

2 Commits

Author SHA1 Message Date
FlamedDogo
c2acc1bb4e
Merge ef03fcb4b2 into b44dfed15c 2024-06-28 09:50:59 -06:00
FlamedDogo99
ef03fcb4b2 Changed userscript functionality
We now are checking for the GM_info object used by userscripts, and using location.href to run the script in the page context if it's found.
2024-06-28 09:50:06 -06:00

View File

@ -6,15 +6,22 @@
// @downloadURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js
// @license Apache License 2.0 - http://www.apache.org/licenses/
// @match https://eaglercraft.com/mc/*
// @version 3.0.5b
// @version 3.0.6
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js
// @run-at document-start
// @grant none
// ==/UserScript==
// Removed brainless unsafeWindow
console.log("Eagler Mobile v3.0.5b")
// TODO: remove the mobile check is implement the dynamic enabling and disabling of individual features
console.log("Eagler Mobile v3.0.6");
// Check for object defined by most userscript applications, and run the script in the page context if so
if (typeof GM_info !== "undefined") {
location.href = "javascript:(" + encodeURI(main) + ")();";
} else {
main();
}
// TODO: remove the mobile check and implement the dynamic enabling and disabling of individual features
function main() {
function isMobile() {
try {
document.createEvent("TouchEvent");
@ -863,3 +870,4 @@ customStyle.textContent = `
}
`;
document.documentElement.appendChild(customStyle);
}