Permission denied to...a non-chrome context

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Permission denied to...a non-chrome context

Andy Fuchs
Hi friends,

I get a strange exception in Firefox 3.5.3 (MacOSX) on *some* widgets. I
can't really nail it down, which widgets are affected (seems to be Buttons
and PopupMenus) and what the similarity (in creation or whatever) is.

So maybe someone here has an idea.

The error is:

Permission denied to...a non-chrome context

in qx.ui.core.Widget.js:

getWidgetByElement : function(element)
 732    {
 733      // In Firefox 2 the related target of mouse events is sometimes an
 734      // anonymous div inside of text area, which raise an exception if
 735      // the parent node is read. This is why the try/catch block is
needed.
 736      try
 737      {
 738        while(element)
 739        {
Permission denied to...a non-chrome context 740          var widgetKey =
element.$$widget;
 741
 742          // dereference "weak" reference to the widget.
 743          if (widgetKey != null) {
 744            return qx.core.ObjectRegistry.fromHashCode(widgetKey);
 745          }
 746
 747          element = element.parentNode;
 748        }
 749      } catch(ex) {}
 750
 751      return null;


It seems to be a Firefox related problem.

Any idea, how I can avoid (or workaround) this?

thx

andy





------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Permission denied to...a non-chrome context

Andy Fuchs

BTW: The uploadWidget contribution suffers from the same problem, as well as
the current <http://demo.qooxdoo.org/current/apiviewer/>

?

andy


On 21.10.09 13:59, "Andy Fuchs" <[hidden email]> wrote:

> Hi friends,
>
> I get a strange exception in Firefox 3.5.3 (MacOSX) on *some* widgets. I
> can't really nail it down, which widgets are affected (seems to be Buttons
> and PopupMenus) and what the similarity (in creation or whatever) is.
>
> So maybe someone here has an idea.
>
> The error is:
>
> Permission denied to...a non-chrome context
>
> in qx.ui.core.Widget.js:
>
> getWidgetByElement : function(element)
>  732    {
>  733      // In Firefox 2 the related target of mouse events is sometimes an
>  734      // anonymous div inside of text area, which raise an exception if
>  735      // the parent node is read. This is why the try/catch block is
> needed.
>  736      try
>  737      {
>  738        while(element)
>  739        {
> Permission denied to...a non-chrome context 740          var widgetKey =
> element.$$widget;
>  741
>  742          // dereference "weak" reference to the widget.
>  743          if (widgetKey != null) {
>  744            return qx.core.ObjectRegistry.fromHashCode(widgetKey);
>  745          }
>  746
>  747          element = element.parentNode;
>  748        }
>  749      } catch(ex) {}
>  750
>  751      return null;
>
>
> It seems to be a Firefox related problem.
>
> Any idea, how I can avoid (or workaround) this?
>
> thx
>
> andy
>
>
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Permission denied to...a non-chrome context

Daniel Wagner
Administrator
Hi Andy,

Fabian tells me that apparently the fix described in
Widget.getWidgetByElement where the call to element.parentNode is
wrapped in a try/catch block won't always prevent this exception because
the anonymous div element can be referenced as an Event's relatedTarget.
The good news is there's already a fix. It hasn't hit trunk yet but
should soon.


Regards,
Daniel

Andy Fuchs schrieb:

> BTW: The uploadWidget contribution suffers from the same problem, as well as
> the current <http://demo.qooxdoo.org/current/apiviewer/>
>
> ?
>
> andy
>
>
> On 21.10.09 13:59, "Andy Fuchs" <[hidden email]> wrote:
>
>> Hi friends,
>>
>> I get a strange exception in Firefox 3.5.3 (MacOSX) on *some* widgets. I
>> can't really nail it down, which widgets are affected (seems to be Buttons
>> and PopupMenus) and what the similarity (in creation or whatever) is.
>>
>> So maybe someone here has an idea.
>>
>> The error is:
>>
>> Permission denied to...a non-chrome context
>>
>> in qx.ui.core.Widget.js:
>>
>> getWidgetByElement : function(element)
>>  732    {
>>  733      // In Firefox 2 the related target of mouse events is sometimes an
>>  734      // anonymous div inside of text area, which raise an exception if
>>  735      // the parent node is read. This is why the try/catch block is
>> needed.
>>  736      try
>>  737      {
>>  738        while(element)
>>  739        {
>> Permission denied to...a non-chrome context 740          var widgetKey =
>> element.$$widget;
>>  741
>>  742          // dereference "weak" reference to the widget.
>>  743          if (widgetKey != null) {
>>  744            return qx.core.ObjectRegistry.fromHashCode(widgetKey);
>>  745          }
>>  746
>>  747          element = element.parentNode;
>>  748        }
>>  749      } catch(ex) {}
>>  750
>>  751      return null;
>>
>>
>> It seems to be a Firefox related problem.
>>
>> Any idea, how I can avoid (or workaround) this?
>>
>> thx
>>
>> andy
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Permission denied to...a non-chrome context

Andy Fuchs
Great... p l e a s e  upload it to the trunk asap :-)

And a side effect of this is, that in

qx.ui.core.EventHandler.js

line 227 crashes, due to an uncaught nil-pointer (or whatever this is called
in JavaScript):
 

if (this.__focusEvents[domEvent.getType()]) {
    currentWidget = currentWidget.getFocusTarget();
}

if (currentWidget == null) return;   // <<< I added this as a quick fix

// Ignore most events in the disabled state.
 var type = domEvent.getType();
  if (!(currentWidget.isEnabled() || this.__ignoreDisabled[type])) {
        return;
 }


best

andy



On 21.10.09 15:18, "Daniel Wagner" <[hidden email]> wrote:

> Hi Andy,
>
> Fabian tells me that apparently the fix described in
> Widget.getWidgetByElement where the call to element.parentNode is
> wrapped in a try/catch block won't always prevent this exception because
> the anonymous div element can be referenced as an Event's relatedTarget.
> The good news is there's already a fix. It hasn't hit trunk yet but
> should soon.
>
>
> Regards,
> Daniel
>
> Andy Fuchs schrieb:
>> BTW: The uploadWidget contribution suffers from the same problem, as well as
>> the current <http://demo.qooxdoo.org/current/apiviewer/>
>>
>> ?
>>
>> andy
>>
>>
>> On 21.10.09 13:59, "Andy Fuchs" <[hidden email]> wrote:
>>
>>> Hi friends,
>>>
>>> I get a strange exception in Firefox 3.5.3 (MacOSX) on *some* widgets. I
>>> can't really nail it down, which widgets are affected (seems to be Buttons
>>> and PopupMenus) and what the similarity (in creation or whatever) is.
>>>
>>> So maybe someone here has an idea.
>>>
>>> The error is:
>>>
>>> Permission denied to...a non-chrome context
>>>
>>> in qx.ui.core.Widget.js:
>>>
>>> getWidgetByElement : function(element)
>>>  732    {
>>>  733      // In Firefox 2 the related target of mouse events is sometimes an
>>>  734      // anonymous div inside of text area, which raise an exception if
>>>  735      // the parent node is read. This is why the try/catch block is
>>> needed.
>>>  736      try
>>>  737      {
>>>  738        while(element)
>>>  739        {
>>> Permission denied to...a non-chrome context 740          var widgetKey =
>>> element.$$widget;
>>>  741
>>>  742          // dereference "weak" reference to the widget.
>>>  743          if (widgetKey != null) {
>>>  744            return qx.core.ObjectRegistry.fromHashCode(widgetKey);
>>>  745          }
>>>  746
>>>  747          element = element.parentNode;
>>>  748        }
>>>  749      } catch(ex) {}
>>>  750
>>>  751      return null;
>>>
>>>
>>> It seems to be a Firefox related problem.
>>>
>>> Any idea, how I can avoid (or workaround) this?
>>>
>>> thx
>>>
>>> andy
>>>
>>>
>>>
>>>
>>>
>>> ----------------------------------------------------------------------------
>>> --
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>
>>
>>
>>
>>
----------------------------------------------------------------------------->>
-

>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>




------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Permission denied to...a non-chrome context

Fabian Jakobs
Administrator
Hi Andy,

i have aplpied my patch in r20468. Could you test, whether this fixes
your problem?

> Great... p l e a s e  upload it to the trunk asap :-)
>
> And a side effect of this is, that in
>
> qx.ui.core.EventHandler.js
>
> line 227 crashes, due to an uncaught nil-pointer (or whatever this is called
> in JavaScript):
>  
>
> if (this.__focusEvents[domEvent.getType()]) {
>     currentWidget = currentWidget.getFocusTarget();
> }
>
> if (currentWidget == null) return;   // <<< I added this as a quick fix
>
> // Ignore most events in the disabled state.
>  var type = domEvent.getType();
>   if (!(currentWidget.isEnabled() || this.__ignoreDisabled[type])) {
>         return;
>  }
>
>  
I have applied htis fix in r20473. Thanks for the fix.

Best Fabian

--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-6784
[hidden email]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel