diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..f2a375a --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "MD024": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 36029c5..fe90737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v0.2.3 + +### Features + +- Reset last played for videos when there are <10 seconds left to watch + ## v0.2.2 ### Features diff --git a/package.json b/package.json index 145eeae..dabc585 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fp-max-extension", "private": true, - "version": "0.2.2", + "version": "0.2.3", "repository": "https://github.com/chenasraf/fp-max-extension", "type": "module", "license": "MIT", diff --git a/src/content_script.ts b/src/content_script.ts index 11dad03..6abc5d7 100644 --- a/src/content_script.ts +++ b/src/content_script.ts @@ -66,6 +66,10 @@ function lastPlayedUpdateCallback(vid: HTMLVideoElement, vidId: string): () => v const key = `lastPlayed-${vidId}` chrome.storage.sync.get([key], (result) => { if (Math.floor(result[key]) === Math.floor(vid.currentTime)) return + if (vid.currentTime >= vid.duration - 10) { + chrome.storage.sync.remove([key]) + return + } chrome.storage.sync.set({ [`lastPlayed-${vidId}`]: vid.currentTime, })