tphant0m Posted December 25, 2006 Share Posted December 25, 2006 I'm trying to inject a bit of javascript into a page to change a few variables. However the page has an onbeforeunload event., window.onbeforeunload = afunction; <body onbeforeunload="afunction"> thus when i try put java script: lines into the address bar, this event fires (because it thinks im trying to navigate away from the page). i have tried a _IEDocReadHTML then remove the events, then a _IEDocWriteHTML (and a _IEAction($oIE, "refresh")) so it actually loads up. however when executing the refresh the onbeforeunload even still loads. (the page im trying to play with deflares a frameset (i understand i HAVE to do that refresh so it actually builds the frame set again). i think im looking for some way to execute javascript in that browser instance via COM or something similar, anything that wont fireaway a navigate away style event. any ideas would be great Link to comment Share on other sites More sharing options...
flyingboz Posted December 25, 2006 Share Posted December 25, 2006 A "why?" woudl be a good inclusion. In addition, the URL to the site in question would be helpful. (of course, failure to provide both of the above lead to suspicion of bad motive.) Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
DaleHohm Posted December 26, 2006 Share Posted December 26, 2006 You could try overriding the current event with something like this: $oIE.document.body.onbeforeunload=';' Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
tphant0m Posted December 26, 2006 Author Share Posted December 26, 2006 (edited) [removed] Edited June 10, 2018 by tphant0m deletion Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now