-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Translate plugin dark mode problem #1931
Comments
Similar to the previous issue #625, but the problem is that the text is difficult to see in dark mode |
Same issue here. My solution is modifying CSS config
Default .jfk-bubble {
background-color: ${white} !important;
} Replacing .jfk-bubble {
background-color: ${dark} !important;
} then click button Maybe it will effect some websites using class |
Okay, this did solve my problem, but hopefully the official can give a better solution (dark mode, but a more recognizable way of text) |
Styling things in shadow DOM is very difficult. Maybe we can look at how Stylus team is trying to tackle it: openstyles/stylus#739 |
@FranklinYu Interesting solution, thanks. Currently I've made a fix here 811cefb But Chrome Web Store update reviews have become too long, so maybe you could try copying the fix into Dark Reader Dev Tools. |
Yes this solution does work! |
Also there used to be an auto-update of these config files from GitHub, but the GitHub team started to complain about huge amount of traffic. |
I think this can be bypassed by CDN + periodic (daily) updates. . . |
I have done this before (updated once a day), and it looks like there should be no problem at this time. If the number of users is really large, then you can use cdn jsdelivr as a relay. . .
The key code is as follows function compatibleAsync(res, callback) {
return res instanceof Promise ? res.then(callback) : callback(res)
}
function onceOfCycle(fn, time) {
const get = window.GM_getValue
const set = window.GM_setValue
const LastUpdateKey = 'LastUpdate'
const LastValueKey = 'LastValue'
return new Proxy(fn, {
apply(_, _this, args) {
const now = Date.now()
const last = get(LastUpdateKey)
if (last !== null && now - last < time) {
return safeExec(() => JSON.parse(get(LastValueKey)))
}
return compatibleAsync(Reflect.apply(_, _this, args), res => {
set(LastUpdateKey, now)
set(LastValueKey, JSON.stringify(res))
return res
})
},
})
} |
Yes CDN can help. In addition to https://www.jsdelivr.com mentioned above, https://statically.io is another famous option. |
Using the official Google Translate plugin: https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb
The text was updated successfully, but these errors were encountered: