darkreader 4.9.113 → 4.9.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/darkreader.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dark Reader v4.9.113
2
+ * Dark Reader v4.9.114
3
3
  * https://darkreader.org/
4
4
  */
5
5
 
@@ -1870,10 +1870,12 @@
1870
1870
  m.startsWith("all") ||
1871
1871
  m.startsWith("(")
1872
1872
  );
1873
- const isPrintOrSpeech = media.some(
1874
- (m) => m.startsWith("print") || m.startsWith("speech")
1875
- );
1876
- if (isScreenOrAllOrQuery || !isPrintOrSpeech) {
1873
+ const isNotScreen =
1874
+ !isScreenOrAllOrQuery &&
1875
+ media.some((m) =>
1876
+ ignoredMedia.some((i) => m.startsWith(i))
1877
+ );
1878
+ if (isScreenOrAllOrQuery || !isNotScreen) {
1877
1879
  iterateCSSRules(rule.cssRules, iterate, onImportError);
1878
1880
  }
1879
1881
  } else if (isSupportsRule(rule)) {
@@ -1887,6 +1889,17 @@
1887
1889
  }
1888
1890
  });
1889
1891
  }
1892
+ const ignoredMedia = [
1893
+ "aural",
1894
+ "braille",
1895
+ "embossed",
1896
+ "handheld",
1897
+ "print",
1898
+ "projection",
1899
+ "speech",
1900
+ "tty",
1901
+ "tv"
1902
+ ];
1890
1903
  const shorthandVarDependantProperties = [
1891
1904
  "background",
1892
1905
  "border",
@@ -4662,6 +4675,12 @@
4662
4675
  if (emptyIsWhereSelector || viewTransitionSelector) {
4663
4676
  selectorText = ".darkreader-unsupported-selector";
4664
4677
  }
4678
+ if (isChromium && selectorText.endsWith("::picker")) {
4679
+ selectorText = selectorText.replaceAll(
4680
+ "::picker",
4681
+ "::picker(select)"
4682
+ );
4683
+ }
4665
4684
  let ruleText = `${selectorText} {`;
4666
4685
  for (const dec of declarations) {
4667
4686
  const {property, value, important} = dec;
@@ -6005,7 +6024,7 @@
6005
6024
  : true) &&
6006
6025
  !isFontsGoogleApiStyle(element))) &&
6007
6026
  !element.classList.contains("darkreader") &&
6008
- element.media.toLowerCase() !== "print" &&
6027
+ !ignoredMedia.includes(element.media.toLowerCase()) &&
6009
6028
  !element.classList.contains("stylus")
6010
6029
  );
6011
6030
  }
package/darkreader.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dark Reader v4.9.113
2
+ * Dark Reader v4.9.114
3
3
  * https://darkreader.org/
4
4
  */
5
5
 
@@ -1828,10 +1828,10 @@ function iterateCSSRules(rules, iterate, onImportError) {
1828
1828
  m.startsWith("all") ||
1829
1829
  m.startsWith("(")
1830
1830
  );
1831
- const isPrintOrSpeech = media.some(
1832
- (m) => m.startsWith("print") || m.startsWith("speech")
1833
- );
1834
- if (isScreenOrAllOrQuery || !isPrintOrSpeech) {
1831
+ const isNotScreen =
1832
+ !isScreenOrAllOrQuery &&
1833
+ media.some((m) => ignoredMedia.some((i) => m.startsWith(i)));
1834
+ if (isScreenOrAllOrQuery || !isNotScreen) {
1835
1835
  iterateCSSRules(rule.cssRules, iterate, onImportError);
1836
1836
  }
1837
1837
  } else if (isSupportsRule(rule)) {
@@ -1845,6 +1845,17 @@ function iterateCSSRules(rules, iterate, onImportError) {
1845
1845
  }
1846
1846
  });
1847
1847
  }
1848
+ const ignoredMedia = [
1849
+ "aural",
1850
+ "braille",
1851
+ "embossed",
1852
+ "handheld",
1853
+ "print",
1854
+ "projection",
1855
+ "speech",
1856
+ "tty",
1857
+ "tv"
1858
+ ];
1848
1859
  const shorthandVarDependantProperties = [
1849
1860
  "background",
1850
1861
  "border",
@@ -4518,6 +4529,12 @@ function createStyleSheetModifier() {
4518
4529
  if (emptyIsWhereSelector || viewTransitionSelector) {
4519
4530
  selectorText = ".darkreader-unsupported-selector";
4520
4531
  }
4532
+ if (isChromium && selectorText.endsWith("::picker")) {
4533
+ selectorText = selectorText.replaceAll(
4534
+ "::picker",
4535
+ "::picker(select)"
4536
+ );
4537
+ }
4521
4538
  let ruleText = `${selectorText} {`;
4522
4539
  for (const dec of declarations) {
4523
4540
  const {property, value, important} = dec;
@@ -5815,7 +5832,7 @@ function shouldManageStyle(element) {
5815
5832
  : true) &&
5816
5833
  !isFontsGoogleApiStyle(element))) &&
5817
5834
  !element.classList.contains("darkreader") &&
5818
- element.media.toLowerCase() !== "print" &&
5835
+ !ignoredMedia.includes(element.media.toLowerCase()) &&
5819
5836
  !element.classList.contains("stylus")
5820
5837
  );
5821
5838
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "darkreader",
3
- "version": "4.9.113",
3
+ "version": "4.9.114",
4
4
  "description": "Dark mode for every website",
5
5
  "scripts": {
6
6
  "api": "node --max-old-space-size=3072 tasks/cli.js build --api",