Skip to content

Commit

Permalink
Update userscript.js
Browse files Browse the repository at this point in the history
  • Loading branch information
YumYummity authored Apr 19, 2023
1 parent 0d138b9 commit 21c447f
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,30 @@
// @author YumYummity
// @match *://*/*
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @connect raw.githubusercontent.com
// ==/UserScript==

var script = document.createElement('script');
script.src = 'https://raw.githubusercontent.com/YumYummity/COCC/main/code/code.js';
document.head.appendChild(script);
(function() {
'use strict';

// Use GM_xmlhttpRequest to fetch the script content
GM_xmlhttpRequest({
method: 'GET',
url: 'https://raw.githubusercontent.com/YumYummity/COCC/main/code/code.js',
onload: function(response) {
if (response.status === 200) {
// Script content loaded successfully
var scriptContent = response.responseText;
// Use eval to execute the script
eval(scriptContent);
console.log('Script loaded and executed successfully.');
} else {
console.error('Failed to load script:', response.statusText);
}
},
onerror: function(error) {
console.error('Failed to load script:', error.statusText);
}
});
})();

0 comments on commit 21c447f

Please sign in to comment.