Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset settings for different URLs #13

Open
tararoshan opened this issue Feb 11, 2024 · 4 comments
Open

Reset settings for different URLs #13

tararoshan opened this issue Feb 11, 2024 · 4 comments

Comments

@tararoshan
Copy link
Owner

No description provided.

@tararoshan
Copy link
Owner Author

tararoshan commented Feb 13, 2024

Might use onHistoryStateUpdated. See Chrome docs and MDN docs.

@tararoshan
Copy link
Owner Author

As mentioned in 0533304,

Also, I need to implement some way of resetting the stored values when a
new video is in use. It could be just tied to the DM logo. I could also
store the URL and clear the session storage every time the URL changes.

But you still have the issue where the video is mirrored, you open a new
tab and run DM there, come back and the video is still mirrored but the
extension doesn't show that. I don't think that's too bad of a
situation, though.

onHistoryStateUpdated seems like an cleaner solution (from the perspective of the user), but it might require more invasive permissions.

@tararoshan
Copy link
Owner Author

I think all of the session storage should be cleared and the content scripts wiped clean. That means

  • disconnect the observer
  • reset playback speed
  • turn off looping
    This could become a hassle if more features are created, so keep that in mind.

@tararoshan
Copy link
Owner Author

For now, I'll tie this to the DM logo.

It'd be useful to tie each DM page to the browser tab, though. Once the tab closes, the state would be cleared. I wanted to originally do this via the browser's sessionStorage property, but that would increase complexity by messaging between the extension page's background scripts and the browser's content scripts (eg. loading the values of the checkbox in the extension based on the value in the browser). It'd be more accurate, though.

tararoshan added a commit that referenced this issue Mar 5, 2024
Fixes #13 temporarily. Will resubmit to the Chrome Web Store after this
change.

Users can now reset the video onscreen and the extension properties by
clicking the Dance Monkey icon. I'd like to create a more intuitive
method of doing this, though!

I may switch to using browser local storage to save default
configurations for saved videos once I implement the Saved Videos page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant