Applications Google
Menu principal

Post a Comment On: Only Python

"Exciting Crunchy News"

7 Comments -

1 – 7 of 7
Anonymous Anonymous said...

sounds cool!!

8:04 AM

Blogger Fuzzyman said...

A link to the project would be useful.

Does look *very* interesting.

10:11 AM

Blogger André Roberge said...

There is a link in my previous post, both to the sourceforge site (for official releases) and to the svn repository. However, I chose not to include a link as the new features I describe are not fully implemented/documented yet in hte "public" version (not even in the svn repository).

10:32 AM

Anonymous Anonymous said...

> Crunchy can load html pages from the web (not only local ones) and perform its magic ;-)

Sounds dangerous!

4:45 PM

Blogger André Roberge said...

I wrote:
> Crunchy can load html pages from the web (not only local ones) and perform its magic ;-)

Anonymous wrote:
Sounds dangerous!
----
You read a Python tutorial on line. You cut-and-paste the code and try it. Is it dangerous? What Crunchy does is no more, no less dangerous than this.

In a few minutes, I have adapted two "official" Python HOWTO tutorials, to include with Crunchy. The adapted version could replace, on their respective website, the original ones with no apparent change to the user loading them up in her favourite browser. However, loading them up via Crunchy, you could just execute the code by clicking a button or, in the case of examples that use the Python interpreter, type in the code in your browser window just below where the original appears, and see the result for yourself.

4:59 PM

Anonymous Anonymous said...

> You read a Python tutorial on line. You cut-and-paste the code and try it. Is it dangerous? What Crunchy does is no more, no less dangerous than this.

So, what is keeping a rogue webpage from executing any Python code from the onload event handler?
This code isn't running in a sandbox, is it?

8:03 PM

Blogger André Roberge said...

anonymous said:

So, what is keeping a rogue webpage from executing any Python code from the onload event handler?
This code isn't running in a sandbox, is it?
======
No it isn't in a sandbox, and yes (with the current version), you are right that there is a potential problem.

The original design was premised on the idea that examples on the web would be loaded from "official sites", but not enough thought had been given. What will likely have to be done *for pages loaded remotely* is something like the following:
1. remove all "script" tags from the original page before it is passed to the browser; (only "script" tags added by crunchy would remain/be allowed);
2. *possibly* remove "src" attributes (which would mean that images would not be loaded); (this might not be needed with Firefox...)
3. otherwise, only retain "title" and "alt" as attributes, in addition to the styling attributes "class" and "id".

Then,
4. add in the local javascript links and css links;
5. display in the browser.

I may have to simply disable the loading remote tutorials for now, until I am more sure about the security :-(

Loading a tutorial locally should be done with the same caution as executing a local python script.

Thank you anonymous1 and anonymous2 (possibly the same person!) for raising this issue.

8:25 PM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot