diff --git a/extension/manifest.json b/extension/manifest.json index d5d8cfe..565c4c6 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "PeerTubeify", - "version": "0.5.1", + "version": "0.5.1.1", "description": "On YouTube, displays a link to the same video on PeerTube, if it exists.", "homepage_url": "https://gitlab.com/Ealhad/peertubeify", "icons": { diff --git a/package.json b/package.json index 97b19ea..99de3f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peertubeify", - "version": "0.5.1", + "version": "0.5.1a", "description": "PeerTubeify is a browser extension to help discovering which YouTube videos are also available on PeerTube.", "main": "webpack.config.js", "dependencies": {}, diff --git a/src/peertube.ts b/src/peertube.ts index 726bd2f..b525579 100644 --- a/src/peertube.ts +++ b/src/peertube.ts @@ -19,7 +19,7 @@ import * as browser from 'webextension-polyfill'; import { htmlToElement, getPeertubeVideoURL } from './util'; import { MessageKind, RedirectType } from './types'; -import { runResume } from './resume'; +import { ResumeManager } from './resume'; import Preferences from './preferences'; const thumbnailURL = (host, path) => `https://${host}${path}`; @@ -60,22 +60,6 @@ async function peertubeify() { } } -const throttledPeertubeify = _.throttle(1000, peertubeify); -const observer = new MutationObserver(function(mutationsList) { - for (const mutation of mutationsList) { - if ((mutation.target as Element).id == 'video-element-wrapper') { - throttledPeertubeify(); - runResume(); - } - } -}); -runResume(); - -observer.observe(document.body, { - childList: true, - subtree: true, -}) - const videoLink = (url, video) => htmlToElement(`