You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
2.0 KiB

(()=>{"use strict";const t=JSON.parse('{"L":[{"host":"www\\\\.netflix\\\\.com","script":"netflix-page.js","path":"watch","autoSync":{"enabled":true}},{"host":"www\\\\.youtube\\\\.com","script":"youtube-page.js","path":"watch","autoSync":{"enabled":true}},{"host":"tver\\\\.jp","script":"tver-page.js","path":"episodes","autoSync":{"enabled":true}},{"host":"www\\\\.b-ch\\\\.com","script":"bandai-channel-page.js","path":"titles","autoSync":{"enabled":true}},{"host":"www\\\\.amazon\\\\..+","script":"amazon-prime-page.js","path":".*","autoSync":{"enabled":true,"videoSrc":"^blob:.+"},"ignore":{"class":"tst-video-overlay-player-html5","style":{"display":"none"}}},{"host":"www\\\\.hulu\\\\..+","script":"hulu-page.js","path":"watch","autoSync":{"enabled":true,"elementId":"content-video-player"}},{"host":"www\\\\.disneyplus\\\\..+","script":"disney-plus-page.js","path":"video","autoSync":{"enabled":true}},{"host":"video.unext.jp","script":"unext-page.js","path":"play","autoSync":{"enabled":false}}]}');class e{constructor(t,e){this.config=t,this.url=e}loadScripts(){const t=document.createElement("script");t.src=chrome.runtime.getURL(`pages/${this.config.script}`),t.onload=()=>t.remove(),(document.head||document.documentElement).appendChild(t)}shouldIgnore(t){if(void 0===this.config.ignore)return!1;if(void 0!==this.config.ignore.class&&t.classList.contains(this.config.ignore.class))return!0;if(void 0!==this.config.ignore.style)for(const e of Object.keys(this.config.ignore.style))if(t.style[e]===this.config.ignore.style[e])return!0;return!1}canAutoSync(t){return this.config.autoSync.enabled&&(void 0===this.config.autoSync.elementId||t.id===this.config.autoSync.elementId)&&(void 0===this.config.autoSync.videoSrc||new RegExp(this.config.autoSync.videoSrc).test(t.src))}isVideoPage(){return new RegExp(this.config.path).test(this.url.pathname)}}(function(){const n=new URL(window.location.href);for(const o of t.L)if(new RegExp(o.host).test(n.host))return new e(o,n)})()?.loadScripts()})();