Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351217 - Firefox 5 & BIRT Viewer - JavaScript issue: Script tags in text box not recognized
Summary: Firefox 5 & BIRT Viewer - JavaScript issue: Script tags in text box not recog...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.1   Edit
Hardware: PC Windows XP
: P3 major with 3 votes (vote)
Target Milestone: 3.7.2   Edit
Assignee: Zhiqiang Qian CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-05 12:13 EDT by Richard Cooper CLA
Modified: 2012-08-16 15:21 EDT (History)
7 users (show)

See Also:


Attachments
Test Report (2.88 KB, application/octet-stream)
2011-07-05 12:16 EDT, Richard Cooper CLA
no flags Details
AbstractReportComponent.js patch (875 bytes, patch)
2011-09-14 22:01 EDT, Zhiqiang Qian CLA
no flags Details | Diff
AbstractReportComponent.js modified (5.65 KB, text/x-c)
2011-09-14 22:01 EDT, Zhiqiang Qian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Cooper CLA 2011-07-05 12:13:16 EDT
Build Identifier: 2.6.1

I have created a simple report with one text box containing some javascript as below:
<script type="text/javascript">alert("Hello");</script>

If I run the report in Firefox version 5, using the BIRT Viewer (on tomcat), the script tags are not recognised.

Note: This bug is firefox 5 specific. The report runs on all other browsers including Firefox 4, IE, Chrome etc. It also runs fine using the Eclipse BIRT Web Viewer

I have attached the sample report. I am using Birt version 2.6.1

The above was working in FireFox 4, so something has changed in FireFox 5.

If I use the same code in a simple HTML page (not in BIRT), it works fine in FireFox 5:

<HTML>
<HEAD>
<script type="text/javascript">alert("Hello");</script>
</HEAD>
<BODY/>
</HTML>

So the issue is BIRT-related when using FireFox 5.

We are using javascript in text boxes to create dynamic reports, so this functionality is of high importance.

Reproducible: Always

Steps to Reproduce:
1. Create a text box and add the code: <script type="text/javascript">alert("Hello");</script>
2. Run the report via the BIRT Viewer on tomcat using Firefox 5 browser
Comment 1 Richard Cooper CLA 2011-07-05 12:16:52 EDT
Created attachment 199139 [details]
Test Report
Comment 2 scottabaxter CLA 2011-07-08 02:38:05 EDT
I am having the same problem. Does anyone know if there is a fix yet for this?
Comment 3 Richard Cooper CLA 2011-07-13 22:21:04 EDT
Same problem occurs with Firefox 6.0 beta
Comment 4 Manoshan Mising name CLA 2011-07-14 00:42:37 EDT
We also have a major loss of functionality when using Firefox 5 due to this issue. 
Our reports are using dynamic javascript sliders inside text boxes to update report information and the sliders are no longer working.
 
Manoshan
Comment 5 Giulio Roggero CLA 2011-09-07 03:55:30 EDT
Same problem occurs with Google Chrome 13 (stable), 14 (beta) and 15 (dev)
Comment 7 Giulio Roggero CLA 2011-09-14 10:04:20 EDT
May be I've found the problem. Birt viewer executes all javascript embedded with this code:

//  Internet Explorer has a funky execScript method that makes this easy
 if ( window.execScript )
     window.execScript( scripts[i].innerHTML );

this don't work anymore in FF and Chrome. Changing this to

//  Internet Explorer has a funky execScript method that makes this easy
if ( window.execScript ){
    window.execScript( scripts[i].innerHTML );
}else {
    with (window) {
        window.eval(scripts[i].innerHTML);
    }
 }

works (http://isolasoftware.it/2011/09/14/birtjavascript/)



Do you think that this is a good solution?
Comment 8 Zhiqiang Qian CLA 2011-09-14 22:00:34 EDT
Giulio,

Thanks for the finding. Here's a patch against 2.6.x and 3.7.x releases and the modified version of AbstractReportComponent.js. Please use it to replace the one under the folder "birt\webcontent\birt\ajax\ui\report" for now.
Comment 9 Zhiqiang Qian CLA 2011-09-14 22:01:09 EDT
Created attachment 203375 [details]
AbstractReportComponent.js patch
Comment 10 Zhiqiang Qian CLA 2011-09-14 22:01:33 EDT
Created attachment 203376 [details]
AbstractReportComponent.js modified
Comment 11 Giulio Roggero CLA 2011-09-15 06:18:47 EDT
Just a note, the bug is also on 2.5.2
Comment 12 D S CLA 2012-08-16 14:38:23 EDT
This is also reported in BIRT 3.7.1 and is an administration nuisance to have to use the patched js file.
Comment 13 D S CLA 2012-08-16 14:40:03 EDT
Is there a way to get this to bubble up since a solution was proposed?
Comment 14 Zhiqiang Qian CLA 2012-08-16 14:48:23 EDT
The patch was included in 3.7.2. I'm closing this to avoid confusion.
Comment 15 D S CLA 2012-08-16 15:21:07 EDT
Thanks for the update!