maildev@lists.thunderbird.net

Thunderbird email developers

View all threads

jQuery and innerHTML issues

CL
Christopher Leidigh
Mon, Aug 12, 2019 2:30 AM

In my adopted extension ThunderStats by Micz , there is a significant
use of jQuery including manipulation of HTML for the the    main tab.

Jorg - you helped Micz when he upgraded for 60 using
document.allowUnsafeHTML which I believe has now been deprecated.

This issue is just a slightly different version than Jonathan is running
into with Sugar.js

While with the extension works fine under 60, I get several unsafe node
errors as well as security error:

Security Error: Content at
moz-nullprincipal:{cd1a52e0-a5a0-4882-a7b3-4142e1a86dff} may not load or
link to chrome://thunderstats/content/mzts-statstab.xhtml.

What are the current options for dealing with this?  Do I really have to
remove jQuery?  There must be something less dramatic.

Christopher

In my adopted extension ThunderStats by Micz , there is a significant use of jQuery including manipulation of HTML for the the    main tab. Jorg - you helped Micz when he upgraded for 60 using document.allowUnsafeHTML which I believe has now been deprecated. This issue is just a slightly different version than Jonathan is running into with Sugar.js While with the extension works fine under 60, I get several unsafe node errors as well as security error: Security Error: Content at moz-nullprincipal:{cd1a52e0-a5a0-4882-a7b3-4142e1a86dff} may not load or link to chrome://thunderstats/content/mzts-statstab.xhtml. What are the current options for dealing with this?  Do I really have to remove jQuery?  There must be something less dramatic. Christopher
JK
Jörg Knobloch
Mon, Aug 12, 2019 7:15 PM

On 12 Aug 2019 04:30, Christopher Leidigh wrote:

In my adopted extension ThunderStats by Micz , there is a significant use of jQuery including manipulation of HTML for the the main tab.

Jorg - you helped Micz when he upgraded for 60 using document.allowUnsafeHTML which I believe has now been deprecated.

This issue is just a slightly different version than Jonathan is running into with Sugar.js

While with the extension works fine under 60, I get several unsafe node errors as well as security error:

Security Error: Content at moz-nullprincipal:{cd1a52e0-a5a0-4882-a7b3-4142e1a86dff} may not load or link to chrome://thunderstats/content/mzts-statstab.xhtml.

What are the current options for dealing with this? Do I really have to remove jQuery? There must be something less dramatic.

Hi all,

yes, I remember helping someone with an add-on that drew pie charts, must have been this one. Yes, the kludge you mentioned does not longer work. Jonathan's "sugar" problem what completely different since he had problems with eval().

When I looked at it, jQuery was using assignments to .innerHTML and that certainly doesn't work any more in a chrome document.

The security error looks like a different issue, you're trying to load/link to a chrome document with a null-principal. You need to find out where that happens.

I'm a little confused here why all this is happening on chrome documents. TB can perfectly well open a HTML content page and given that it has a full web browser under the hood, you can run any JS you like, including assigning to .innerHTLM.

As a starter, try |openContentTab("http://www.jorgk.com", "tab");| in the error console, or any page you choose, for example one with heavy jQuery usage.

Jörg.

PM
Paul Morris
Mon, Aug 12, 2019 7:18 PM

On 8/11/19 10:30 PM, Christopher Leidigh wrote:

In my adopted extension ThunderStats by Micz , there is a significant
use of jQuery including manipulation of HTML for the the main tab.

This is probably not immediately relevant, but if you ever decide to
drop the jQuery dependency:

http://youmightnotneedjquery.com/

-Paul

On 8/11/19 10:30 PM, Christopher Leidigh wrote: > In my adopted extension ThunderStats by Micz , there is a significant > use of jQuery including manipulation of HTML for the the main tab. > This is probably not immediately relevant, but if you ever decide to drop the jQuery dependency: http://youmightnotneedjquery.com/ -Paul