| Summary: | Storage events are fired for the same tab | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Merih Akar <merihakar> | ||||
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED DUPLICATE | ||||||
| Severity: | Normal | CC: | bdrasin, beidson, cdumez, jimmy, rkit.ru, sihui_liu, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 13 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=211503 | ||||||
| Attachments: |
|
||||||
I can confirm this with Safari 13.1 (14609.1.20.111.8) on macOS 10.14.6 (18G4032), as well as with Safari on iOS (iPhone) 13.7.
Work around: Only execute OnStorage logic if document is not focused:
if (!document.hasFocus())
{
// Execute OnStorage logic - tab does not have focus
}
Notice though that hasFocus() will return false in the active tab if Developer Tools is open and has focus.
Work around suggestion only makes sense if OnStorage events are triggered by user interaction, of course. Also, it seems Safari Developer Tools does not steal focus from the document - Chrome Developer Tools does. This rings a bell and I thought I had fixed this. Are you able to try in Safari Technology Preview? This looks a lot like (In reply to Chris Dumez from comment #5) > This looks a lot like This looks a lot like https://bugs.webkit.org/show_bug.cgi?id=211503 which got fixed. (In reply to Chris Dumez from comment #6) > (In reply to Chris Dumez from comment #5) > > This looks a lot like > > This looks a lot like https://bugs.webkit.org/show_bug.cgi?id=211503 which > got fixed. Chris Dumez: It sure does sound like the same thing. Safari Version 14.0.1 (14610.2.11.51.9) works as expected. I can no longer reproduce the problem with localStorage. I think its safe to close this bug report, although I'm not the one who initially reported the bug - I just confirmed it. - Thank you Jimmy (In reply to Jimmy Thomsen from comment #7) > (In reply to Chris Dumez from comment #6) > > (In reply to Chris Dumez from comment #5) > > > This looks a lot like > > > > This looks a lot like https://bugs.webkit.org/show_bug.cgi?id=211503 which > > got fixed. > > Chris Dumez: It sure does sound like the same thing. Safari Version 14.0.1 > (14610.2.11.51.9) works as expected. I can no longer reproduce the problem > with localStorage. I think its safe to close this bug report, although I'm > not the one who initially reported the bug - I just confirmed it. > > - Thank you > > Jimmy Awesome. Thank you for confirming! *** This bug has been marked as a duplicate of bug 211503 *** |
Created attachment 396456 [details] testcase As per specification storage events should be fired for the tabs other than the tab that's changing the storage area, however it's also fired on the same tab in Safari. Note that the issue happens when the testcase file is served via a server, doesn't happen when you open it directly in the browser.