-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
816 lines (753 loc) · 24.1 KB
/
index.html
File metadata and controls
816 lines (753 loc) · 24.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
<!DOCTYPE html>
<!--
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"%3C/div>
/>
<style>
.ad-placeholder {
align-items: center;
background-color: lightgrey;
display: flex;
justify-content: center;
}
table {
border: 1px solid black;
border-collapse: collapse;
height: fit-content;
}
tr {
height: 100%;
}
td {
border: 1px solid black;
padding: 0;
}
dl {
min-width: 150px;
padding: 0 5px;
}
dt {
font-weight: bold;
}
dd {
font-size: 0.9em;
margin-left: 0;
margin-top: 10px;
}
.link-type {
background-color: beige;
width: 50%;
}
.link-target {
display: table;
height: 50%;
text-align: center;
width: 100%;
}
.link-target:nth-child(even) {
border-top: 1px solid black;
background-color: whitesmoke;
}
.link-target a {
display: table-cell;
font-family: monospace;
vertical-align: middle;
}
.ad-placeholder:empty::before {
background-color: dimgrey;
border-radius: 5px;
color: lightgrey;
content: "Advertisement";
font: 12px sans-serif;
padding: 3px;
text-align: center;
width: 100px;
}
.webview-container,
.browser-container {
border: 3px solid black;
padding: 10px 10px;
}
.counter {
font-size: 2rem;
vertical-align: sub;
}
.hidden {
display: none;
}
</style>
<style>
@media (prefers-color-scheme: dark) {
body {
background-color: #121212;
color: #e0e0e0;
}
.webview-container,
.browser-container {
border-color: #555;
}
table,
td {
border-color: #555;
}
.link-type {
background-color: #2a2a2a;
}
.link-target:nth-child(even) {
background-color: #1e1e1e;
border-top-color: #555;
}
.link-target a {
color: #8ab4f8;
}
.ad-placeholder {
background-color: #333;
}
.ad-placeholder:empty::before {
background-color: #555;
color: #ccc;
}
}
</style>
<script
async
src=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://securepubads.g.doubleclick.net/tag/js/gpt.js"%3C/div>
></script>
</head>
<body>
<div class="container-fluid mt-2">
<h1>Web View API for Ads Test Page</h1>
<!-- Part 1: Set up the web view -->
<div class="webview-container hidden">
<h3 class="mb-2" id="webview-settings-tests">
Set up <span class="webview-name">WebView</span>
</h3>
<h5 class="mb-2">Web view settings</h5>
<p>
Tests for your <span class="webview-name">WebView</span> setup, which
help improve ad relevance and performance.
</p>
<!-- Third party cookies-->
<div
class="alert alert-success hidden"
role="alert"
id="third-party-cookies-success"
>
✅ Third party cookies work
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="third-party-cookies-error-android"
>
⚠ Third party cookies are NOT functioning which may adversely impact
ad performance.
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developers.google.com/ad-manager/mobile-ads-sdk/android/webview#enable_third-party_cookies"%3C/div>
>Enable third party cookies</a
>
for best performance.
</div>
<div
class="alert alert-warning hidden"
role="alert"
id="third-party-cookies-error-ios"
>
ℹ Third party cookies are NOT functioning which may adversely impact
ad performance, but this is expected on iOS devices.
</div>
<!-- First party cookies-->
<div
class="alert alert-success hidden"
role="alert"
id="first-party-cookies-success"
>
✅ First party cookies work
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="first-party-cookies-failure"
>
⚠ First party cookies are NOT functioning which may adversely impact
ad performance.
<span id="first-party-cookies-failure-android" class="hidden"
>Please ensure
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developer.android.com/reference/android/webkit/CookieManager#setAcceptCookie(boolean)"%3C/div>
>cookies</a
>
have not been turned off</span
>.
</div>
<!-- JavaScript-->
<div
class="alert alert-success hidden"
role="alert"
id="javascript-enabled-success"
>
✅ JavaScript enabled
</div>
<noscript>
<div
class="alert alert-danger"
role="alert"
id="javascript-enabled-error"
>
⚠ JavaScript is disabled. WebView integration with GMA SDK requires
JavaScript to be enabled.
</div>
</noscript>
<!-- DOM Storage-->
<div
class="alert alert-success hidden"
role="alert"
id="dom-storage-enabled-success"
>
✅ DOM storage enabled.
</div>
<div
class="alert alert-warning hidden"
role="alert"
id="dom-storage-enabled-failure"
>
ℹ DOM storage is disabled. This may impact ads performance. Please
double check
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developers.google.com/ad-manager/mobile-ads-sdk/android/webview#web_settings"%3C/div>
>the instructions</a
>.
</div>
<!-- Video Ad-->
<h5>Video ad</h5>
<h6>Make sure the ad:</h6>
<ul>
<li>Plays inline.</li>
<li>Plays automatically without clicking the play button.</li>
<li>Is replayable.</li>
</ul>
<div
id="video-ad"
class="border border-3 border-secondary rounded ad-placeholder mb-3"
style="width: 306px; height: 256px"
></div>
<p id="theme-footnote" class="mt-3"></p>
</div>
<br />
<!-- Part 2: WebView API for Ads -->
<div class="browser-container">
<h3 id="api-for-ads-tests" class="mb-2">Web view API for ads</h3>
<!-- GPT alerts -->
<div
class="alert alert-success hidden"
role="alert"
id="gpt-connected-success"
>
✅ Google Publisher Tag connected to GMA SDK
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="gpt-connected-error"
>
⚠ Google Publisher Tag NOT connected with GMA SDK. Please contact
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/admanager/answer/3059042"%3C/div>
>Ad Manager</a
>
or
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/adsense/answer/2581949"%3C/div>
>AdSense</a
>
support.
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="gpt-connected-error-2"
>
⚠ Could not confirm Google Publisher Tag connection with GMA SDK.
Performance API was unable to locate the ad request. Please contact
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/admanager/answer/3059042"%3C/div>
>Ad Manager</a
>
or
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/adsense/answer/2581949"%3C/div>
>AdSense</a
>
support.
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="gpt-connected-error-3"
>
⚠ Could not confirm Google Publisher Tag connection with GMA SDK.
Unable to query the Performance API. Please contact
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/admanager/answer/3059042"%3C/div>
>Ad Manager</a
>
or
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://support.google.com/adsense/answer/2581949"%3C/div>
>AdSense</a
>
support.
</div>
<!-- Chrome Custom Tab alerts -->
<div
class="alert alert-success hidden"
role="alert"
id="chrome-custom-tab-success"
>
✅ Chrome Custom Tab connected to GMA SDK
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="chrome-custom-tab-failure"
>
⚠ Chrome Custom Tab NOT connected with GMA SDK. Please double check
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developers.google.com/ad-manager/mobile-ads-sdk/android/browser/custom-tabs"%3C/div>
>the instructions</a
>.
</div>
<!-- part 1 -->
<div
class="alert alert-success hidden"
role="alert"
id="webview-connected-success"
>
✅ <span class="webview-name">WebView</span> connected to GMA SDK
</div>
<div
class="alert alert-danger hidden"
role="alert"
id="webview-connected-error"
>
⚠ <span class="webview-name">WebView</span> NOT connected with GMA
SDK.
<span class="hidden" id="webview-connected-error-android"
>Please double check
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developers.google.com/ad-manager/mobile-ads-sdk/android/webview/api-for-ads"%3C/div>
>the instructions</a
>.</span
><span class="hidden" id="webview-connected-error-ios"
>Please double check
<a
class="alert-link"
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developers.google.com/ad-manager/mobile-ads-sdk/ios/webview/api-for-ads"%3C/div>
>the instructions</a
>.</span
>
</div>
<!-- part 2 -->
<h5>Reservation ad</h5>
<div
id="reservation-ad"
class="border border-3 border-secondary rounded ad-placeholder mb-3"
style="width: 306px; height: 256px"
></div>
</div>
<br />
<div class="webview-container hidden">
<div>
<iframe src=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://googleads.github.io/webview-ads-3rd-party-cookie-checker/test/" hidden></iframe>
</div>
<h3 id="click-behavior-tests">Optimize click behavior</h3>
<h5>Auction ad</h5>
<p>Click on the AdChoices links and make sure they work.</p>
<div
id="auction-ad"
class="border border-3 border-secondary rounded ad-placeholder mb-3"
style="width: 306px; height: 256px"
></div>
<div>
<span class="counter"></span>
<p>
Check that the link brings you to the right place and the timer does
not reset upon your return to the page.
</p>
</div>
<h5 id="href-links">href click tests</h5>
<table>
<tr>
<td class="link-type">
<dl>
<dt>In-app browser</dt>
<dd>Check the links open in the in-app browser.</dd>
</dl>
</td>
<td>
<span class="link-target">
<a target="_top" href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://google.com/">target="_top"</a>%3C/div>
</span>
<span class="link-target">
<a target="_blank" href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://google.com/"%3C/div>
>target="_blank"</a
>
</span>
</td>
</tr>
<tr class="android-links hidden">
<td class="link-type">
<dl>
<dt>Google Play Store (https://)</dt>
<dd>
Check the links open in the Google Play Store app. If the
Google Play Store app isn't installed on device, links open in
the in-app browser instead.
</dd>
</dl>
</td>
<td>
<span class="link-target">
<a
target="_top"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox"%3C/div>
>target="_top"</a
>
</span>
<span class="link-target">
<a
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox"%3C/div>
>target="_blank"</a
>
</span>
</td>
</tr>
<tr class="android-links hidden">
<td class="link-type">
<dl>
<dt>Google Play Store (market://)</dt>
<dd>
Check the links open in the Google Play Store app. If the
Google Play Store app isn't installed on device, clicking the
link shows a
<a
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developer.android.com/guide/topics/ui/notifiers/toasts"%3C/div>
>Toast</a
>.
</dd>
</dl>
</td>
<td>
<span class="link-target">
<a
target="_top"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"market://details?id=com.google.android.googlequicksearchbox"%3C/div>
>target="_top"</a
>
</span>
<span class="link-target">
<a
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"market://details?id=com.google.android.googlequicksearchbox"%3C/div>
>target="_blank"</a
>
</span>
</td>
</tr>
<tr class="ios-links hidden">
<td class="link-type">
<dl>
<dt>App Store</dt>
<dd>Check the links open in the in App Store app.</dd>
</dl>
</td>
<td>
<span class="link-target">
<a
target="_top"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://apps.apple.com/us/app/google/id284815942"%3C/div>
>target="_top"</a
>
</span>
<span class="link-target">
<a
target="_blank"
href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://apps.apple.com/us/app/google/id284815942"%3C/div>
>target="_blank"</a
>
</span>
</td>
</tr>
</table>
<br />
<h5 id="javascipt-links">JavaScript click test</h5>
<p>Check the link opens in the in-app browser.</p>
<button type="button" onclick="openWindowBlank()">
window.open("_blank")
</button>
</div>
<br />
</div>
</body>
<script>
const ios = isiOS();
if (ios) {
document.querySelectorAll(".webview-name").forEach((elem) => {
elem.textContent = "WKWebView";
});
}
// Show/Hide the respective web view solution containers based on the "browser" query parameter.
const params = new URLSearchParams(window.location.search);
const isWebView = params.get("browser") !== "cct";
if (isWebView) {
showElement(".webview-container");
testWebViewAPI();
}
// Make an ad request.
window.googletag = window.googletag || {
cmd: [],
};
googletag.cmd.push(() => {
googletag.pubads().addEventListener("slotOnload", () =>
setTimeout(() => {
// Test browser connection to GPT.
testBrowserConnection();
}, 1)
);
googletag
.defineSlot(
"/6355419/Travel/Europe/France/Paris",
[300, 250],
"reservation-ad"
)
.addService(googletag.pubads());
googletag
.defineSlot(
"/1015330/ca-gfp-rama1/piyr-latency-adsense-image-300x250",
[300, 250],
"auction-ad"
)
.addService(googletag.pubads().set("adsense_test_mode", "on"));
googletag
.defineSlot("/6062/qgeng_video_test_ad_unit_1", [300, 200], "video-ad")
.addService(googletag.pubads());
// Disable ad expansion.
googletag.setConfig({
adExpansion: { enabled: false },
});
googletag.pubads().enableSingleRequest();
googletag.enableServices();
// Only need one call to display() with single request mode enabled.
googletag.display("video-ad");
});
function testBrowserConnection() {
const noError = document
.getElementById("webview-connected-error")
.classList.contains("hidden");
try {
const gptUrl = performance
.getEntriesByType("resource")
.filter(({ name }) => name.includes("/gampad/ads?"))
.pop();
if (gptUrl) {
const params = new URLSearchParams(gptUrl.name);
// PACT check - "wst" of 4 or 5 it indicates a successful Chrome Custom Tab integration.
if (!isWebView) {
const wstParam = params.get("wst");
if (wstParam === "4" || wstParam === "5") {
showElement("#chrome-custom-tab-success");
} else {
showElement("#chrome-custom-tab-failure");
}
}
if (params.has("scar")) {
showElement("#gpt-connected-success");
} else {
// Detected the global but no scar parameter found.
// Contact Google Ad Manager support for help resolving this.
if (noError) {
showElement("#gpt-connected-error");
}
}
} else {
if (noError) {
showElement("#gpt-connected-error-2");
}
}
} catch (err) {
if (noError) {
showElement("#gpt-connected-error-3");
}
}
}
function openWindowBlank() {
window.open("http://google.com", "_blank");
}
function showElement(selector) {
document
.querySelectorAll(selector)
.forEach((elem) => elem.classList.remove("hidden"));
}
// Set up
// https://stackoverflow.com/questions/9038625/detect-if-device-is-ios
// https://github.com/chrisdancee/react-ios-pwa-prompt/issues/15?utm_source=chatgpt.com
function isiOS() {
return (
[
"iPad Simulator",
"iPhone Simulator",
"iPod Simulator",
"iPad",
"iPhone",
"iPod",
].includes(navigator.platform) ||
// iPad on iOS 13 detection
(navigator.userAgent.includes("Mac") && (navigator.maxTouchPoints > 1 || "ontouchend" in document))
);
}
// Part 1 -- test JS
showElement("#javascript-enabled-success");
// Part 2 -- test WebView api for ads [WebView only]
function testWebViewAPI() {
if (
(typeof window.gmaSdk !== "undefined" &&
typeof window.gmaSdk.getQueryInfo === "function") ||
(typeof window.webkit !== "undefined" &&
typeof window.webkit.messageHandlers !== "undefined" &&
typeof window.webkit.messageHandlers.getGmaQueryInfo !==
"undefined" &&
typeof window.webkit.messageHandlers.getGmaQueryInfo.postMessage ===
"function") ||
(typeof window.webkit !== "undefined" &&
typeof window.webkit.messageHandlers !== "undefined" &&
typeof window.webkit.messageHandlers.getGmaSig !== "undefined" &&
typeof window.webkit.messageHandlers.getGmaSig.postMessage ===
"function")
) {
showElement("#webview-connected-success");
} else {
showElement("#webview-connected-error");
if (!ios) {
showElement("#webview-connected-error-android");
} else {
showElement("#webview-connected-error-ios");
}
}
}
// Part 3 -- test DOM Storage [Android only]
if (!ios) {
const testKey = "__testgoog__";
try {
localStorage.setItem(testKey, "1");
} catch {
showElement("#dom-storage-enabled-failure");
} finally {
try {
if (localStorage.getItem(testKey) === "1") {
showElement("#dom-storage-enabled-success");
} else {
showElement("#dom-storage-enabled-failure");
}
localStorage.removeItem(testKey);
} catch {}
}
}
// Part 4 -- test for 3P cookies
if (ios) {
showElement("#third-party-cookies-error-ios");
} else {
const receiveMessage = (evt) => {
if (evt.data === "3PCunsupported") {
showElement("#third-party-cookies-error-android");
} else if (evt.data === "3PCsupported") {
showElement("#third-party-cookies-success");
}
};
window.addEventListener("message", receiveMessage, false);
}
// Part 5 -- test for 1P cookies
document.cookie = "firstparty=yes; Max-Age=3600; SameSite=Strict";
if (!/firstparty=yes/.test(document.cookie)) {
showElement("#first-party-cookies-failure");
if (!ios) {
showElement("#first-party-cookies-failure-android");
}
} else {
showElement("#first-party-cookies-success");
}
// Part 6 -- show links for iOS/Android
if (ios) {
showElement(".ios-links");
} else {
showElement(".android-links");
}
// Part 7 -- show the counter
let count = 0;
setInterval(() => {
document.querySelector(".counter").textContent = count++;
}, 1000);
</script>
<script>
// Light/Dark mode support.
const darkModeMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
const themeFootnote = document.getElementById("theme-footnote");
function updateTheme(event) {
const isDark = event.matches;
// This runs for all devices to set the theme.
document.documentElement.setAttribute("data-bs-theme", isDark ? "dark" : "light");
// Only run for Android devices.
if (!isiOS()) {
const themeName = isDark ? "dark" : "light";
themeFootnote.innerHTML = '<small>' +
'This page uses <a href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme" target="_blank">prefers-color-scheme</a> ' +
'to detect the light or dark theme setting from the webview context. The detected theme is ' + themeName + '. If your webview theme setting ' +
'does not match the theme setting of your app, please follow the ' +
'<a href=/proxy/https/github.com/google/webview-ads/blob/main/test/"https://developer.android.com/develop/ui/views/layout/webapps/dark-theme" target"_blank">Darken web content in WebView</a> ' +
'instructions.</small>';
}
}
// Initial check.
updateTheme(darkModeMediaQuery);
// Listen for changes.
darkModeMediaQuery.addEventListener("change", updateTheme);
</script>
</html>
You can’t perform that action at this time.