Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Now onScroll uses debounce on saveHistory #233

Closed
wants to merge 1 commit into from

Conversation

diegonvs
Copy link
Contributor

@diegonvs diegonvs commented Dec 6, 2017

When CI run my tests on #232, it catches some errors that being shown below:
image

I've noticed that replaceState security error is caused by spamming scroll event when updating history state. Using debounce we can reduce the occurrence of replaceState event and solve this Security Error.

@eduardolundgren
Copy link
Contributor

eduardolundgren commented Dec 7, 2017

This will cause issues. The scroll snapshot must happen synchronously, adding a debounce will cause intermittent issues. In the past we've tried this approach.

@diegonvs
Copy link
Contributor Author

diegonvs commented Dec 7, 2017

Hey @eduardolundgren, which issues this modification will cause? I've noticed that people using others libs (e.g Ember, react-router, dom-to-img) are getting same errors[1][2][3] and they are getting some manners to solve this, but i think that reload page and emit warnings may be bad SPA experience to user.

  • Fix these issues that will be caused by debouncing
  • Emit a warning when we encounter this exception
  • Provide an option that reloads the page when we encounter this exception
  • Remove support for Safari (this is probably the worst manner to solve this)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants