Improve domain detection code
The previous version could be fooled by random domains that happen to end in youtube.com and suchlike.
This commit is contained in:
Родитель
9b3476df0e
Коммит
3a65dd0df2
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
const IS_YOUTUBE = window.location.hostname.endsWith('youtube.com') ||
|
||||
window.location.hostname.endsWith('youtube-nocookie.com');
|
||||
const IS_VIMEO = window.location.hostname.endsWith('vimeo.com');
|
||||
const IS_YOUTUBE = window.location.hostname.search(/(?:^|.+\.)youtube.com/) > -1 ||
|
||||
window.location.hostname.search(/(?:^|.+\.)youtube-nocookie.com/) > -1;
|
||||
const IS_VIMEO = window.location.hostname.search(/(?:^|.+\.)vimeo.com/) > -1;
|
||||
|
||||
// Page Visibility API
|
||||
Object.defineProperties(document.wrappedJSObject,
|
||||
|
|
Загрузка…
Ссылка в новой задаче