(Document document)
| 2625 | } |
| 2626 | |
| 2627 | static void fakeDark(Document document) { |
| 2628 | // https://issuetracker.google.com/issues/237785596 |
| 2629 | // https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert |
| 2630 | // https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate |
| 2631 | // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme |
| 2632 | // https://developer.android.com/reference/android/webkit/WebSettings#setAlgorithmicDarkeningAllowed(boolean) |
| 2633 | |
| 2634 | if (true || hasColorScheme(document, "dark")) |
| 2635 | return; |
| 2636 | |
| 2637 | document.head().appendElement("style").html( |
| 2638 | "body { filter: invert(100%) hue-rotate(180deg) !important; background: black !important; }" + |
| 2639 | "img { filter: invert(100%) hue-rotate(180deg) !important; }"); |
| 2640 | } |
| 2641 | |
| 2642 | static String getLanguage(Context context, String subject, String text) { |
| 2643 | try { |
nothing calls this directly
no test coverage detected