extension-develop 4.0.28 → 4.0.29-next.0

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.
@@ -11025,6 +11025,748 @@ function patchChromiumBackground(manifest, browser) {
11025
11025
  }
11026
11026
  };
11027
11027
  }
11028
+ const NAMED_CSS_COLORS = {
11029
+ aliceblue: [
11030
+ 240,
11031
+ 248,
11032
+ 255
11033
+ ],
11034
+ antiquewhite: [
11035
+ 250,
11036
+ 235,
11037
+ 215
11038
+ ],
11039
+ aqua: [
11040
+ 0,
11041
+ 255,
11042
+ 255
11043
+ ],
11044
+ aquamarine: [
11045
+ 127,
11046
+ 255,
11047
+ 212
11048
+ ],
11049
+ azure: [
11050
+ 240,
11051
+ 255,
11052
+ 255
11053
+ ],
11054
+ beige: [
11055
+ 245,
11056
+ 245,
11057
+ 220
11058
+ ],
11059
+ bisque: [
11060
+ 255,
11061
+ 228,
11062
+ 196
11063
+ ],
11064
+ black: [
11065
+ 0,
11066
+ 0,
11067
+ 0
11068
+ ],
11069
+ blanchedalmond: [
11070
+ 255,
11071
+ 235,
11072
+ 205
11073
+ ],
11074
+ blue: [
11075
+ 0,
11076
+ 0,
11077
+ 255
11078
+ ],
11079
+ blueviolet: [
11080
+ 138,
11081
+ 43,
11082
+ 226
11083
+ ],
11084
+ brown: [
11085
+ 165,
11086
+ 42,
11087
+ 42
11088
+ ],
11089
+ burlywood: [
11090
+ 222,
11091
+ 184,
11092
+ 135
11093
+ ],
11094
+ cadetblue: [
11095
+ 95,
11096
+ 158,
11097
+ 160
11098
+ ],
11099
+ chartreuse: [
11100
+ 127,
11101
+ 255,
11102
+ 0
11103
+ ],
11104
+ chocolate: [
11105
+ 210,
11106
+ 105,
11107
+ 30
11108
+ ],
11109
+ coral: [
11110
+ 255,
11111
+ 127,
11112
+ 80
11113
+ ],
11114
+ cornflowerblue: [
11115
+ 100,
11116
+ 149,
11117
+ 237
11118
+ ],
11119
+ cornsilk: [
11120
+ 255,
11121
+ 248,
11122
+ 220
11123
+ ],
11124
+ crimson: [
11125
+ 220,
11126
+ 20,
11127
+ 60
11128
+ ],
11129
+ cyan: [
11130
+ 0,
11131
+ 255,
11132
+ 255
11133
+ ],
11134
+ darkblue: [
11135
+ 0,
11136
+ 0,
11137
+ 139
11138
+ ],
11139
+ darkcyan: [
11140
+ 0,
11141
+ 139,
11142
+ 139
11143
+ ],
11144
+ darkgoldenrod: [
11145
+ 184,
11146
+ 134,
11147
+ 11
11148
+ ],
11149
+ darkgray: [
11150
+ 169,
11151
+ 169,
11152
+ 169
11153
+ ],
11154
+ darkgreen: [
11155
+ 0,
11156
+ 100,
11157
+ 0
11158
+ ],
11159
+ darkgrey: [
11160
+ 169,
11161
+ 169,
11162
+ 169
11163
+ ],
11164
+ darkkhaki: [
11165
+ 189,
11166
+ 183,
11167
+ 107
11168
+ ],
11169
+ darkmagenta: [
11170
+ 139,
11171
+ 0,
11172
+ 139
11173
+ ],
11174
+ darkolivegreen: [
11175
+ 85,
11176
+ 107,
11177
+ 47
11178
+ ],
11179
+ darkorange: [
11180
+ 255,
11181
+ 140,
11182
+ 0
11183
+ ],
11184
+ darkorchid: [
11185
+ 153,
11186
+ 50,
11187
+ 204
11188
+ ],
11189
+ darkred: [
11190
+ 139,
11191
+ 0,
11192
+ 0
11193
+ ],
11194
+ darksalmon: [
11195
+ 233,
11196
+ 150,
11197
+ 122
11198
+ ],
11199
+ darkseagreen: [
11200
+ 143,
11201
+ 188,
11202
+ 143
11203
+ ],
11204
+ darkslateblue: [
11205
+ 72,
11206
+ 61,
11207
+ 139
11208
+ ],
11209
+ darkslategray: [
11210
+ 47,
11211
+ 79,
11212
+ 79
11213
+ ],
11214
+ darkslategrey: [
11215
+ 47,
11216
+ 79,
11217
+ 79
11218
+ ],
11219
+ darkturquoise: [
11220
+ 0,
11221
+ 206,
11222
+ 209
11223
+ ],
11224
+ darkviolet: [
11225
+ 148,
11226
+ 0,
11227
+ 211
11228
+ ],
11229
+ deeppink: [
11230
+ 255,
11231
+ 20,
11232
+ 147
11233
+ ],
11234
+ deepskyblue: [
11235
+ 0,
11236
+ 191,
11237
+ 255
11238
+ ],
11239
+ dimgray: [
11240
+ 105,
11241
+ 105,
11242
+ 105
11243
+ ],
11244
+ dimgrey: [
11245
+ 105,
11246
+ 105,
11247
+ 105
11248
+ ],
11249
+ dodgerblue: [
11250
+ 30,
11251
+ 144,
11252
+ 255
11253
+ ],
11254
+ firebrick: [
11255
+ 178,
11256
+ 34,
11257
+ 34
11258
+ ],
11259
+ floralwhite: [
11260
+ 255,
11261
+ 250,
11262
+ 240
11263
+ ],
11264
+ forestgreen: [
11265
+ 34,
11266
+ 139,
11267
+ 34
11268
+ ],
11269
+ fuchsia: [
11270
+ 255,
11271
+ 0,
11272
+ 255
11273
+ ],
11274
+ gainsboro: [
11275
+ 220,
11276
+ 220,
11277
+ 220
11278
+ ],
11279
+ ghostwhite: [
11280
+ 248,
11281
+ 248,
11282
+ 255
11283
+ ],
11284
+ gold: [
11285
+ 255,
11286
+ 215,
11287
+ 0
11288
+ ],
11289
+ goldenrod: [
11290
+ 218,
11291
+ 165,
11292
+ 32
11293
+ ],
11294
+ gray: [
11295
+ 128,
11296
+ 128,
11297
+ 128
11298
+ ],
11299
+ green: [
11300
+ 0,
11301
+ 128,
11302
+ 0
11303
+ ],
11304
+ greenyellow: [
11305
+ 173,
11306
+ 255,
11307
+ 47
11308
+ ],
11309
+ grey: [
11310
+ 128,
11311
+ 128,
11312
+ 128
11313
+ ],
11314
+ honeydew: [
11315
+ 240,
11316
+ 255,
11317
+ 240
11318
+ ],
11319
+ hotpink: [
11320
+ 255,
11321
+ 105,
11322
+ 180
11323
+ ],
11324
+ indianred: [
11325
+ 205,
11326
+ 92,
11327
+ 92
11328
+ ],
11329
+ indigo: [
11330
+ 75,
11331
+ 0,
11332
+ 130
11333
+ ],
11334
+ ivory: [
11335
+ 255,
11336
+ 255,
11337
+ 240
11338
+ ],
11339
+ khaki: [
11340
+ 240,
11341
+ 230,
11342
+ 140
11343
+ ],
11344
+ lavender: [
11345
+ 230,
11346
+ 230,
11347
+ 250
11348
+ ],
11349
+ lavenderblush: [
11350
+ 255,
11351
+ 240,
11352
+ 245
11353
+ ],
11354
+ lawngreen: [
11355
+ 124,
11356
+ 252,
11357
+ 0
11358
+ ],
11359
+ lemonchiffon: [
11360
+ 255,
11361
+ 250,
11362
+ 205
11363
+ ],
11364
+ lightblue: [
11365
+ 173,
11366
+ 216,
11367
+ 230
11368
+ ],
11369
+ lightcoral: [
11370
+ 240,
11371
+ 128,
11372
+ 128
11373
+ ],
11374
+ lightcyan: [
11375
+ 224,
11376
+ 255,
11377
+ 255
11378
+ ],
11379
+ lightgoldenrodyellow: [
11380
+ 250,
11381
+ 250,
11382
+ 210
11383
+ ],
11384
+ lightgray: [
11385
+ 211,
11386
+ 211,
11387
+ 211
11388
+ ],
11389
+ lightgreen: [
11390
+ 144,
11391
+ 238,
11392
+ 144
11393
+ ],
11394
+ lightgrey: [
11395
+ 211,
11396
+ 211,
11397
+ 211
11398
+ ],
11399
+ lightpink: [
11400
+ 255,
11401
+ 182,
11402
+ 193
11403
+ ],
11404
+ lightsalmon: [
11405
+ 255,
11406
+ 160,
11407
+ 122
11408
+ ],
11409
+ lightseagreen: [
11410
+ 32,
11411
+ 178,
11412
+ 170
11413
+ ],
11414
+ lightskyblue: [
11415
+ 135,
11416
+ 206,
11417
+ 250
11418
+ ],
11419
+ lightslategray: [
11420
+ 119,
11421
+ 136,
11422
+ 153
11423
+ ],
11424
+ lightslategrey: [
11425
+ 119,
11426
+ 136,
11427
+ 153
11428
+ ],
11429
+ lightsteelblue: [
11430
+ 176,
11431
+ 196,
11432
+ 222
11433
+ ],
11434
+ lightyellow: [
11435
+ 255,
11436
+ 255,
11437
+ 224
11438
+ ],
11439
+ lime: [
11440
+ 0,
11441
+ 255,
11442
+ 0
11443
+ ],
11444
+ limegreen: [
11445
+ 50,
11446
+ 205,
11447
+ 50
11448
+ ],
11449
+ linen: [
11450
+ 250,
11451
+ 240,
11452
+ 230
11453
+ ],
11454
+ magenta: [
11455
+ 255,
11456
+ 0,
11457
+ 255
11458
+ ],
11459
+ maroon: [
11460
+ 128,
11461
+ 0,
11462
+ 0
11463
+ ],
11464
+ mediumaquamarine: [
11465
+ 102,
11466
+ 205,
11467
+ 170
11468
+ ],
11469
+ mediumblue: [
11470
+ 0,
11471
+ 0,
11472
+ 205
11473
+ ],
11474
+ mediumorchid: [
11475
+ 186,
11476
+ 85,
11477
+ 211
11478
+ ],
11479
+ mediumpurple: [
11480
+ 147,
11481
+ 112,
11482
+ 219
11483
+ ],
11484
+ mediumseagreen: [
11485
+ 60,
11486
+ 179,
11487
+ 113
11488
+ ],
11489
+ mediumslateblue: [
11490
+ 123,
11491
+ 104,
11492
+ 238
11493
+ ],
11494
+ mediumspringgreen: [
11495
+ 0,
11496
+ 250,
11497
+ 154
11498
+ ],
11499
+ mediumturquoise: [
11500
+ 72,
11501
+ 209,
11502
+ 204
11503
+ ],
11504
+ mediumvioletred: [
11505
+ 199,
11506
+ 21,
11507
+ 133
11508
+ ],
11509
+ midnightblue: [
11510
+ 25,
11511
+ 25,
11512
+ 112
11513
+ ],
11514
+ mintcream: [
11515
+ 245,
11516
+ 255,
11517
+ 250
11518
+ ],
11519
+ mistyrose: [
11520
+ 255,
11521
+ 228,
11522
+ 225
11523
+ ],
11524
+ moccasin: [
11525
+ 255,
11526
+ 228,
11527
+ 181
11528
+ ],
11529
+ navajowhite: [
11530
+ 255,
11531
+ 222,
11532
+ 173
11533
+ ],
11534
+ navy: [
11535
+ 0,
11536
+ 0,
11537
+ 128
11538
+ ],
11539
+ oldlace: [
11540
+ 253,
11541
+ 245,
11542
+ 230
11543
+ ],
11544
+ olive: [
11545
+ 128,
11546
+ 128,
11547
+ 0
11548
+ ],
11549
+ olivedrab: [
11550
+ 107,
11551
+ 142,
11552
+ 35
11553
+ ],
11554
+ orange: [
11555
+ 255,
11556
+ 165,
11557
+ 0
11558
+ ],
11559
+ orangered: [
11560
+ 255,
11561
+ 69,
11562
+ 0
11563
+ ],
11564
+ orchid: [
11565
+ 218,
11566
+ 112,
11567
+ 214
11568
+ ],
11569
+ palegoldenrod: [
11570
+ 238,
11571
+ 232,
11572
+ 170
11573
+ ],
11574
+ palegreen: [
11575
+ 152,
11576
+ 251,
11577
+ 152
11578
+ ],
11579
+ paleturquoise: [
11580
+ 175,
11581
+ 238,
11582
+ 238
11583
+ ],
11584
+ palevioletred: [
11585
+ 219,
11586
+ 112,
11587
+ 147
11588
+ ],
11589
+ papayawhip: [
11590
+ 255,
11591
+ 239,
11592
+ 213
11593
+ ],
11594
+ peachpuff: [
11595
+ 255,
11596
+ 218,
11597
+ 185
11598
+ ],
11599
+ peru: [
11600
+ 205,
11601
+ 133,
11602
+ 63
11603
+ ],
11604
+ pink: [
11605
+ 255,
11606
+ 192,
11607
+ 203
11608
+ ],
11609
+ plum: [
11610
+ 221,
11611
+ 160,
11612
+ 221
11613
+ ],
11614
+ powderblue: [
11615
+ 176,
11616
+ 224,
11617
+ 230
11618
+ ],
11619
+ purple: [
11620
+ 128,
11621
+ 0,
11622
+ 128
11623
+ ],
11624
+ rebeccapurple: [
11625
+ 102,
11626
+ 51,
11627
+ 153
11628
+ ],
11629
+ red: [
11630
+ 255,
11631
+ 0,
11632
+ 0
11633
+ ],
11634
+ rosybrown: [
11635
+ 188,
11636
+ 143,
11637
+ 143
11638
+ ],
11639
+ royalblue: [
11640
+ 65,
11641
+ 105,
11642
+ 225
11643
+ ],
11644
+ saddlebrown: [
11645
+ 139,
11646
+ 69,
11647
+ 19
11648
+ ],
11649
+ salmon: [
11650
+ 250,
11651
+ 128,
11652
+ 114
11653
+ ],
11654
+ sandybrown: [
11655
+ 244,
11656
+ 164,
11657
+ 96
11658
+ ],
11659
+ seagreen: [
11660
+ 46,
11661
+ 139,
11662
+ 87
11663
+ ],
11664
+ seashell: [
11665
+ 255,
11666
+ 245,
11667
+ 238
11668
+ ],
11669
+ sienna: [
11670
+ 160,
11671
+ 82,
11672
+ 45
11673
+ ],
11674
+ silver: [
11675
+ 192,
11676
+ 192,
11677
+ 192
11678
+ ],
11679
+ skyblue: [
11680
+ 135,
11681
+ 206,
11682
+ 235
11683
+ ],
11684
+ slateblue: [
11685
+ 106,
11686
+ 90,
11687
+ 205
11688
+ ],
11689
+ slategray: [
11690
+ 112,
11691
+ 128,
11692
+ 144
11693
+ ],
11694
+ slategrey: [
11695
+ 112,
11696
+ 128,
11697
+ 144
11698
+ ],
11699
+ snow: [
11700
+ 255,
11701
+ 250,
11702
+ 250
11703
+ ],
11704
+ springgreen: [
11705
+ 0,
11706
+ 255,
11707
+ 127
11708
+ ],
11709
+ steelblue: [
11710
+ 70,
11711
+ 130,
11712
+ 180
11713
+ ],
11714
+ tan: [
11715
+ 210,
11716
+ 180,
11717
+ 140
11718
+ ],
11719
+ teal: [
11720
+ 0,
11721
+ 128,
11722
+ 128
11723
+ ],
11724
+ thistle: [
11725
+ 216,
11726
+ 191,
11727
+ 216
11728
+ ],
11729
+ tomato: [
11730
+ 255,
11731
+ 99,
11732
+ 71
11733
+ ],
11734
+ turquoise: [
11735
+ 64,
11736
+ 224,
11737
+ 208
11738
+ ],
11739
+ violet: [
11740
+ 238,
11741
+ 130,
11742
+ 238
11743
+ ],
11744
+ wheat: [
11745
+ 245,
11746
+ 222,
11747
+ 179
11748
+ ],
11749
+ white: [
11750
+ 255,
11751
+ 255,
11752
+ 255
11753
+ ],
11754
+ whitesmoke: [
11755
+ 245,
11756
+ 245,
11757
+ 245
11758
+ ],
11759
+ yellow: [
11760
+ 255,
11761
+ 255,
11762
+ 0
11763
+ ],
11764
+ yellowgreen: [
11765
+ 154,
11766
+ 205,
11767
+ 50
11768
+ ]
11769
+ };
11028
11770
  const isChannel = (entry)=>'number' == typeof entry && Number.isInteger(entry) && entry >= 0 && entry <= 255;
11029
11771
  const isFiniteNumber = (entry)=>'number' == typeof entry && Number.isFinite(entry);
11030
11772
  function parseHexThemeColor(value) {
@@ -11040,8 +11782,33 @@ function parseHexThemeColor(value) {
11040
11782
  Math.round(bytes[3] / 255 * 1000) / 1000
11041
11783
  ];
11042
11784
  }
11785
+ function parseCssThemeColor(value) {
11786
+ const hex = parseHexThemeColor(value);
11787
+ if (hex) return hex;
11788
+ if ('string' != typeof value) return;
11789
+ const keyword = value.trim().toLowerCase();
11790
+ if ('transparent' === keyword) return [
11791
+ 0,
11792
+ 0,
11793
+ 0,
11794
+ 0
11795
+ ];
11796
+ const named = NAMED_CSS_COLORS[keyword];
11797
+ if (named) return [
11798
+ ...named
11799
+ ];
11800
+ const match = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(0|1|0?\.\d+|1\.0+)\s*)?\)$/.exec(keyword);
11801
+ if (!match) return;
11802
+ const channels = match.slice(1, 4).map(Number);
11803
+ if (channels.some((channel)=>channel > 255)) return;
11804
+ if (void 0 === match[4]) return channels;
11805
+ return [
11806
+ ...channels,
11807
+ Number(match[4])
11808
+ ];
11809
+ }
11043
11810
  function colorValueDetail(value) {
11044
- if (parseHexThemeColor(value)) return;
11811
+ if (parseCssThemeColor(value)) return;
11045
11812
  if (!Array.isArray(value) || 3 !== value.length && 4 !== value.length) return 'Chrome only accepts an [R, G, B] or [R, G, B, A] array here.';
11046
11813
  for (const entry of value.slice(0, 3))if (!isChannel(entry)) return 'Chrome only accepts integer color channels from 0 to 255 here.';
11047
11814
  if (4 === value.length && !isFiniteNumber(value[3])) return 'Chrome only accepts a numeric alpha channel here.';
@@ -11084,7 +11851,7 @@ function patchChromiumThemeColors(manifest, browser) {
11084
11851
  let converted = false;
11085
11852
  const patchedColors = {};
11086
11853
  for (const [key, value] of Object.entries(colors)){
11087
- const rgb = parseHexThemeColor(value);
11854
+ const rgb = parseCssThemeColor(value);
11088
11855
  patchedColors[key] = rgb ?? value;
11089
11856
  if (rgb) converted = true;
11090
11857
  }