[Webkit-unassigned] [Bug 83012] Web Inspector: localStorage items are not updated when the storage changes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 5 04:35:36 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=83012


Vivek Galatage <vivekgalatage at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vivekgalatage at gmail.com




--- Comment #1 from Vivek Galatage <vivekgalatage at gmail.com>  2012-04-05 04:35:35 PST ---
After analyzing the scenario, I have arrived at two points where this needs to be fixed

1. The front-end inspector code should listen on window.addEventListener("storage") so that any updates in the storage will be notified to the inspector.

2. The backend part: Currently the StorageEventDispatcher takes the responsibility of dispatching the storage related events to the related pages grouped in PageGroup object.

So in the case when I open two different tabs for the same URL as demoed in this http://html5demos.com/storage-events, these two different pages are grouped under the same group. So the statement in StorageEventDispatcher::dispatch()

for (unsigned i = 0; i < frames.size(); ++i) {
    ExceptionCode ec = 0;
    Storage* storage = frames[i]->domWindow()->localStorage(ec);
    if (!ec)
        frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
}

takes care of dispatching the storage event to the other page.

But the same is not applicable with the inspector page. Inspector page is not in the same group as of the page being inspected.

So now we have to either change the inspector protocol scheme to introduce a new method in the inspector.json to support custom type of event for storage events and propagate them same as being currently done. 

The other option could be bringing the inspector page also under the same group as that of the page being inspected.

But for the second option I am not aware of any security concerns of having main page and the inspector page in the same group. Please comment if know the rational behind separating the Inspector page from the main page group.

Also lets say the main page is listening on the events such as storage (as done in http://html5demos.com/storage-events), then if I go ahead and add some new property:value pair in the inspector->resources->local storage view, the main page is not getting notified again because of PageGroup differences.

I am working on these issues for further resolution and will update soon with the patch.

Thank you,
Vivek

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list