-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extName": { | ||
"message": "ShinyColors async app script", | ||
"description": "Extension name" | ||
}, | ||
"desc": { | ||
"message": "Make third-party userscripts load more stable by setting the async attribute on the game's app script", | ||
"description": "Extension description" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extName": { | ||
"message": "闪耀色彩异步脚本", | ||
"description": "扩展名" | ||
}, | ||
"desc": { | ||
"message": "通过给游戏的app脚本设置async属性使第三方用户脚本更稳定的加载", | ||
"description": "Extension description" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const mutationCallback = (mutationsList) => { | ||
for (let mutation of mutationsList) { | ||
const addedNodes = mutation.addedNodes | ||
addedNodes.forEach(node => { | ||
if ('SCRIPT' === node.tagName) { | ||
if (node.src.includes('shinycolors.enza.fun/app')) { | ||
node.async = true | ||
observer.disconnect() | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
|
||
const obConfig = { | ||
subtree: true, | ||
childList: true | ||
} | ||
|
||
const targetNode = document | ||
const observer = new MutationObserver(mutationCallback) | ||
observer.observe(targetNode, obConfig) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "__MSG_extName__", | ||
"description": "__MSG_desc__", | ||
"version": "1.0", | ||
"manifest_version": 3, | ||
"default_locale": "zh_CN", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["*://shinycolors.enza.fun/*"], | ||
"run_at": "document_start", | ||
"js": ["content-script.js"] | ||
} | ||
], | ||
"icons": { | ||
"128": "/icon.png" | ||
} | ||
} |
72f2399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snowyivu @Damillora
https://chrome.google.com/webstore/detail/caafhkjcgpbinkgnghkojaoipgdkbcbc
I've released a chrome extension that can fix the problem that userscript sometimes doesn't load successfully.
Here's the code: https://github.com/biuuu/ShinyColors/tree/master/extension
72f2399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
群主biuuu !!
Thank you very much! I will repay you with a gift - who is your favorite idol?
72f2399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! My favorite idol is Mano.
72f2399
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://imgbb.com/rm4LMSN
Late gift for you I commissioned <3
( https://twitter.com/Jon__Eve/status/1533186900449562624 )