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.
related to #241 and #210
This patch simply prevents unregistering of the Application Cache event handlers after 5 seconds - only the timer is still being stopped after 5 seconds (the timer is used as a workaround should events not work).
This fixes
offline-plugin
for iPhone/iPad/Safari (tested) and IE/Edge (probably) when 5 seconds are not enough to check for updates and download assets.IMHO this shouldn't break anything as the timer-workaround will behave like before. The 5-seconds problem will continue to exist for situations where the timer is really needed (when events don't work due to browser bugs).
I don't know which browsers really need the timer hack, but events seem to work fine on iOS/Webkit and also IE10 & Edge, where this patch makes a huge difference, because application get the chance to update immediately.