bug-librejs
[Top][All Lists]
Advanced

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

[Bug-librejs] Possible issues with dynamically created base64 encoded fr


From: Ivaylo Valkov
Subject: [Bug-librejs] Possible issues with dynamically created base64 encoded free software JavaScript
Date: Sat, 04 Aug 2012 21:27:18 +0300

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/

Attachment: lm-librejs-bas64-data.txt.bz2
Description: application/bzip

Attachment: lm-librejs-dynamic.png
Description: PNG image

Attachment: lm-librejs-static.png
Description: PNG image

Attachment: lm-librejs-decoded.txt.bz2
Description: application/bzip

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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