Need a way to include scripts and styles in /type/page

Bug #515770 reported by Edward Betts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Library
Won't Fix
High
Anand Chitipothu

Bug Description

/type/page content is sanitized before display, this removes styles and scripts. We need a way to be able to include styles and scripts on pages.

Does this need a new type, or a switch on the page to skip the sanitizer?

Changed in openlibrary:
importance: Undecided → High
assignee: nobody → Anand Chitipothu (anandology)
status: New → Confirmed
Revision history for this message
Anand Chitipothu (anandology) wrote :

We can't allow this. It is security risk. People can add javascripts to steal cookies.

I can think of a work-around if can point me to a couple of examples.

Changed in openlibrary:
milestone: none → upstream
Revision history for this message
Edward Betts (edwardbetts) wrote :

The example is http://upstream.openlibrary.org/contact/spam

Should we use a different page type? Ask Lance for more details.

Revision history for this message
Lance Arthur (lance-arthur) wrote :

Specific to that page (and perhaps there's a more elegant and system-friendly way to do it) we wanted to use Javascript to extract the browser history so we could insert the spammy URL in question inside the form automatically. Then we wondered about using pages when we wanted to or had to use some kind of code to "do something" and perhaps a Private Page or an Internal Page or Admin Page or something might be useful in those situations.

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 515770] Re: Need a way to include scripts and styles in /type/page

On 06-Feb-10, at 2:19 AM, Edward Betts wrote:

> The example is http://upstream.openlibrary.org/contact/spam
>
> Should we use a different page type? Ask Lance for more details.

That should be driven by a template. I've added template and added
code for handling /contact/spam.

Anand

Revision history for this message
Anand Chitipothu (anandology) wrote :

> Specific to that page (and perhaps there's a more elegant and system-
> friendly way to do it) we wanted to use Javascript to extract the
> browser history so we could insert the spammy URL in question inside
> the
> form automatically. Then we wondered about using pages when we
> wanted to
> or had to use some kind of code to "do something" and perhaps a
> Private
> Page or an Internal Page or Admin Page or something might be useful in
> those situations.

I've added to code to populate email and url.

For example: http://upstream.openlibrary.org/contact/spam?path=/books/OL1M

Don't you think it will better if we make it a popup?

Revision history for this message
George (george-archive) wrote :

Make the form a pop-up, you mean? Why?

Would be perfect if the form could redirect back to the page reported, with a flash confirmation message that says "Thanks for your report. We'll look into it as soon as we can, and if you provided an email address, we'll get back to you if we need to."

Changed in openlibrary:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.