blob: a26c45bd56d5bb834fa9022632aee904a1066b7a [file] [log] [blame]
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02001export var unifiedProfilesFix = {
2 checkIframe(iframe) {
3 var srcRegex = /support.*\.google\.com\/profile\//;
4 return srcRegex.test(iframe.src ?? '');
5 },
6 fixIframe(iframe) {
Adrià Vilanova Martínez5b987932023-11-16 02:18:44 +01007 console.debug('[unifiedProfilesFix] Fixing unified profiles iframe');
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02008 var url = new URL(iframe.src);
9 url.searchParams.set('dark', 1);
10 iframe.src = url.href;
11 },
12};