bug-librejs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-librejs] Possible issues with dynamically created base64 encode


From: Loic J. Duros
Subject: Re: [Bug-librejs] Possible issues with dynamically created base64 encoded free software JavaScript
Date: Tue, 21 Aug 2012 16:41:56 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

Hi:

Yes, the problem is the dataURI, I assume. LibreJS either looks for an external file in the src tag and attempts to find a license there, or it looks for a license in inline scripts, or through JS Web Labels. The problem I assume is that a dataURI is neither, so I'll check and see how we could get a fix for that.

Thanks for your report,

Loic


On 08/04/2012 02:27 PM, Ivaylo Valkov wrote:
Hello,

I'm trying to make Linterna Mágica [1] work with LibreJS. Linterna
Mágica is a userscript that plays flash video clips without flash
plugin. It is of course written in JavaScript.

Userscripts in GNU IceCat (and other Firefox forks and versions) are
not normally executed in the page context, but because of the
sandboxed environment of userscript extensions and their limitations,
Linterna Mágica is injected in the page and runs in its scope. Since
day one the script had the proper license headers as suggested in the
JavaScript Trap, but they were never injected in the page with the
script, so LibreJS blocks Linterna Mágica.

I've made some changes to the code in my working copy and at least
theoretically Linterna Mágica should work with LibreJS, but it
doesn't.  It seems the problem comes from the dynamically created
script tag with base64 encoded data.

I've created a static script tag with the same contents as the
dynamically created one and it is marked as accepted by LibreJS, while
the dynamic one is not. See attached images.

I've attached the base64 data as text as well. This is the
compiled/generated/"binary" version of Linterna Mágica from my working
copy with the latest changes. This code is not yet in the repository
and is nowhere else available. If needed I'll commit it in the
repository, so it is easier to test.

The easiest decoding method: copy to a browser address bar.  It might
bloat the browser. Well, the following might be even easier:

$ bzcat lm-librejs-bas64-data.txt.bz2 | cut -d',' -f2 |base64 -d \
decoded.txt
I also attached the code in plain text - without the base64 encoding.

When LibreJS is disabled, the same dynamic script tag works and
Linterna Mágica loads as expected.

What am I missing? I thank you in advance.

[1] http://linterna-magica.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]