Repository navigation
Load card recognition when the video plays; free it after 10 idle minutes - #36
Merged
Merged
Conversation
The content script makes the compute frame, which loads the model, when the page's main video starts playing with card hovers on (or at once when it is already playing as hovers turn on). The first hover then usually meets a loaded session. The tooltip frame still waits for the pointer, nothing is analyzed before it, and a video that never plays loads on the first pointer move over its picture, as before. Hovers off, pages with no video and installs still load nothing. The privacy page and the docs say the release download now happens when a video plays; the settings refresh and the details file still wait for a hover. Signed-off-by: RDCLder <raymondyang.dev@gmail.com>
After IDLE_UNLOAD_MS (10 minutes) with no trusted move over the picture and no card showing, the content script removes both frames, which frees the model's memory. The next trusted pointer move anywhere in the page while the video plays, or the video playing again after a pause, makes the compute frame again, so the load runs while the pointer travels to the card. A `playing` with no pause first (a stall, a loop) does not reload. A dev build can shorten the idle time with --idle-unload-ms to check the unload; other builds refuse the flag. Signed-off-by: RDCLder <raymondyang.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two behavior changes for 0.8.0, which hasn't been uploaded yet.
Load at play (7bc7256). The content script makes the compute frame, which loads the model, when the page's main video starts playing with card hovers on. If the video is already playing when hovers turn on, it loads at once. The first hover then usually meets a loaded model.
Idle unload (33a6113). After 10 minutes with no move over the picture and no card showing, both frames are removed, which frees the model's memory.
playingevent with no pause first (a buffering stall, a loop, an ad) does not reload.--idle-unload-ms; other builds refuse the flag.The privacy page and the docs now say the release download happens when a video plays. The settings refresh and the card details file still wait for a hover.
Measured on an Apple-silicon Mac (native Chrome for Testing 152, dev builds):
Checks: 595 tests pass (type check and vitest), and lint is clean.