Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript code is not replecable #17

Closed
GoogleCodeExporter opened this issue Aug 21, 2015 · 11 comments
Closed

Javascript code is not replecable #17

GoogleCodeExporter opened this issue Aug 21, 2015 · 11 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. try to match something in a javascript and replace it

What is the expected output? What do you see instead?

the expected behavior would be to have the javascript working with the
replaced part. If you look into the source code, the substitution works,
but I guess the Javascript is already loaded when this happen and as such
it doesnt change the natural behavior.

What version of the product are you using? On what operating system?
0.10.0



Original issue reported on code.google.com by mome...@gmail.com on 21 Jun 2009 at 12:40

@GoogleCodeExporter
Copy link
Author

Can you provide a specific example?

JavaScript is interpreted, and as such, if the code is changed the behaviour 
should
change too. But I haven't tried.

Original comment by marc.r...@gmail.com on 22 Jun 2009 at 10:22

@GoogleCodeExporter
Copy link
Author

You can try this code:

<SCRIPT LANGUAGE="JavaScript">
function openWindows() {
var nextURL = "http://www.google.com";
var inventoryView = window.open
(nextURL,'',"toolbar=0,status=0,scrollbars=1,resizable=1,width=650,height=500");
}
</SCRIPT>

<A HREF="javascript:openWindows();">TEST</A>

try to change the website, or one of the parameter the javascript will continue 
to 
open the same page in the same size.

Original comment by mome...@gmail.com on 22 Jun 2009 at 3:09

@GoogleCodeExporter
Copy link
Author

Well, yes, it continues to open Google. I suppose that although the text of the
script is changed, it isn't reparsed and the function remains the same. I don't 
know
if the reparsing can be forced, but I will look what can be done.

Original comment by marc.r...@gmail.com on 24 Jun 2009 at 11:13

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Issue 27 has been merged into this issue.

Original comment by marc.r...@gmail.com on 19 Jan 2010 at 11:14

@GoogleCodeExporter
Copy link
Author

Having same issue cannot change javascript please add me to email list

Original comment by ccciaba...@gmail.com on 9 Mar 2010 at 1:13

@GoogleCodeExporter
Copy link
Author

ccciabarra, if you have starred the issue you will receive an e-mail when it is 
updated.

Original comment by marc.r...@gmail.com on 17 Mar 2010 at 10:49

@GoogleCodeExporter
Copy link
Author

Tried version 0.12.2 on FFox8 - still no luck with JavaScript. I need to mock 
some javascript functions in order to proceed with Selenium automated testing 
of large web project.

Original comment by van...@gmail.com on 18 Nov 2011 at 6:01

@GoogleCodeExporter
Copy link
Author

I still don't know how to solve it, sorry :(

Original comment by marc.r...@gmail.com on 18 Nov 2011 at 11:10

@GoogleCodeExporter
Copy link
Author

I've got a functional (but long) workaround in Issue 75

Instead of altering existing functions in the HTML, re-define the complete 
function with your changes. 

Original comment by mpheyse%...@gtempaccount.com on 14 Jul 2012 at 7:22

@GoogleCodeExporter
Copy link
Author

Good news! I have found a way to solve this, different from mpheyse's solution, 
and it will be included in next release. It doesn't solve issue 75, though, but 
I will work on that later.

Original comment by marc.r...@gmail.com on 11 Nov 2012 at 4:46

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Fixed in r163. The solution has been to replace each changed script node (or 
each script node in HTML) with a newly created one with the changed code. I 
have left it as an option disabled by default, so it doesn't bother users that 
don't want to change scripts. Also, by the moment it applies only to scripts in 
the body, as the rest the substitutions, but the solution will work when I 
allow substitutions in the head.

The fix will be included in the next release. If you encounter any problem with 
this new option, please create a new bug report.

Original comment by marc.r...@gmail.com on 11 Nov 2012 at 11:29

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants