You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by "Scott Wilson (JIRA)" <ji...@apache.org> on 2012/07/12 18:29:35 UTC

[jira] [Commented] (WOOKIE-359) Widget.preferences.setItem don´t work if widget contains an iframe with a remote src

    [ https://issues.apache.org/jira/browse/WOOKIE-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412909#comment-13412909 ] 

Scott Wilson commented on WOOKIE-359:
-------------------------------------

Thanks for the bug report Michael.

The problem lies wookie-wrapper.js, with this function:

    this.__raiseEvent = function(key, value, oldValue){
        //
        // Raise custom storage event
        //  
        var evt;
        if(document.createEvent){
          evt = document.createEvent("Event");
        } else { // IE before v 9
          evt = document.createEventObject(window.event);
        }      
        var evt = document.createEvent("Event");
        evt.initEvent("storage", false,false);
        evt.key = key;
        evt.newValue = value;
        evt.oldValue = oldValue;
        evt.url      = window.location;
        evt.storageArea = widget.preferences;
        //
        // Dispatch to child frames
        //
        var frames = window.frames;
        for (var i=0;i<frames.length;i++){
            if(document.createEvent){
               frames[i].dispatchEvent(evt);  
            } else { // IE before v 9
               frames[i].fireEvent("storage", evt);
            }  
        }   
    }


One solution is to only fire events at same-origin frames; another is to handle exceptions rather than let them reach the user.
                
> Widget.preferences.setItem don´t work if widget contains an iframe with a remote src
> ------------------------------------------------------------------------------------
>
>                 Key: WOOKIE-359
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-359
>             Project: Wookie
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 0.9.2, 0.10.0, 0.11.0
>         Environment: Win7 x86
>            Reporter: Michael Hertel
>            Priority: Minor
>             Fix For: 0.12.0
>
>
> Bug occurs by using an iframe with a remote url inside the widget. In that case the user agent always denies the access to the property 'dispatchEvent' (wookie-wrapper.js, line 229), if the "widget.preferences.setItem" function is called. Seems to be a cross-origin request issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira