Resorted to toggling active scripting
def toggle_javascript_capability(is_capable, zone_id)
regpath = Software\\Microsoft\\Windows\\CurrentVersion\\Internet
Settings\\Zones\\#{zone_id}
puts regpath
regvalue = '3'
if is_capable then
regvalue = '0'
end
Win32::Registry::HKEY_CURRENT_USER.open(regpath,
Win32::Registry::KEY_WRITE) do |reg|
reg['1400', Win32::Registry::REG_DWORD]= regvalue
end
end
#js on
(0..4).each { |zone| toggle_javascript_capability(true, zone) }
#js off
(0..4).each { |zone| toggle_javascript_capability(false, zone) }
Need to close and re-start the browser though
Aidy
2009/11/25 aidy lewis aidy.le...@googlemail.com:
Ethan,
Same thing, but good suggestion.
I am not even sure of the differences between eval and execScript.
Cheers
Aidy
2009/11/25 Ethan notet...@gmail.com:
Do you get the same thing if you try
browser.document.parentWindow.eval(whatever) ?
On Wed, Nov 25, 2009 at 13:26, aidy lewis aidy.le...@googlemail.com wrote:
Hi,
I am trying to execute some js in IE8:
browser.ie.document.parentWindow.execScript(window.confirm=function(){return
true});
However, I am getting an 'Access denied' error when I have scripting
allowed in my IE settings and I am on the same domain as the
application server.
Aidy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---
--
You received this message because you are subscribed to the Google Groups
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/watir-general