[help] InternetExplorer Object events... |
Author: |
Message: |
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. [help] InternetExplorer Object events...
Reference: http://msdn.microsoft.com/en-us/library/aa752084.aspx
Methods can be accessed through Browser.Method() and properties can be accessed through Browser.Property. My question is: can you get to events? Is it possible to call a function when navigation starts, or finishes?
Oh, and is it possible to see what's in the history? I know I can keep track of it in an array or something, but is there a function for it?
|
|
01-15-2010 09:06 PM |
|
|
roflmao456
Skinning Contest Winner
Posts: 955 Reputation: 24
30 / /
Joined: Nov 2006
Status: Away
|
RE: [help] InternetExplorer Object events...
yeah. pretty similar to how i do WMP events in WLMini Music Player.
set a variable to the interface and then do:
code: function variablename::eventname(parameters){
}
This post was edited on 01-16-2010 at 03:45 AM by roflmao456.
[quote]
Ultimatess6: What a noob mod
|
|
01-16-2010 03:45 AM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [help] InternetExplorer Object events...
js code: var Window = MsgPlus.CreateWnd("Windows.xml", "WndBrowser", 0);
var BrowserObj = Window.Browser_GetInterface("Browser");
BrowserObj.GoHome();
function BrowserObj::BeforeNavigate()
{
// do loading stuff
}
code: Message in Script Debug
Script is starting
Error: 'BrowserObj' is undefined (code: -2146823279)
File: Browser.js. Line: 4.
Script has failed to start
It seems that none of the events work. Any ideas?
Edit: tried with variables, still didn't work.
js code: function BrowserObj::BeforeNavigate(pDisp, url, Flags, TargetFrameName, PostData, Headers, Cancel)
This post was edited on 01-16-2010 at 11:20 AM by whiz.
|
|
01-16-2010 11:17 AM |
|
|
felipEx
Scripting Contest Winner
Posts: 378 Reputation: 24
35 / /
Joined: Jun 2006
|
RE: RE: [help] InternetExplorer Object events...
quote: Originally posted by whiz
It seems that none of the events work. Any ideas?
this should do the trick
JScript code: var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
var browser = Wnd.Browser_GetInterface("browser");
(function(Browser) {
function Browser::DocumentComplete(){
}
function Browser::NavigateComplete2(pDisp, URL){
Debug.Trace(URL);
}
function Browser::TitleChange(sText){
}
function Browser::DownloadBegin(){
}
function Browser::ProgressChange(nProgress, nProgressMax){
}
})(browser);
browser.Navigate2("http://www.google.com");
// browser.GoHome();
As for keeping track of the history list you could manually do it using the appropriate event
|
|
01-16-2010 10:15 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [help] InternetExplorer Object events...
Works great, thanks!
Next question... the Browser::NavigateComplete() function is fired when pages in frames are loaded, and I am using that function to set the loaded page's address in the address bar. Is there a way to filter it between main pages and framed pages?
|
|
01-17-2010 01:37 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
|
01-18-2010 04:27 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [help] InternetExplorer Object events...
quote: Originally posted by matty
Have you looked at the MSDN page? It states that there are 2 parameters for the function... first one being the web browser object second being the URL...
Surely the object parameter will just contain the browser object, regardless of frames?
Edit: ah, hold on...
quote: Originally posted by MSDN
pDisp
Object that evaluates to the top-level or frame WebBrowser object corresponding to the event.
Fair enough.
Ok, another question. The Browser::BeforeNavigate() and Browser::BeforeNavigate2() functions don't get called, and nor does the Browser::NewWindow(), Browser::NewWindow2() and Browser::NewWindow3() functions. Any possible reasons why? Are they not supported?
This post was edited on 01-18-2010 at 05:19 PM by whiz.
|
|
01-18-2010 05:15 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [help] InternetExplorer Object events...
No the second parameter is the URL. A frame is going to have a different URL than the main page...
|
|
01-18-2010 05:47 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [help] InternetExplorer Object events...
quote: Originally posted by matty
No the second parameter is the URL. A frame is going to have a different URL than the main page...
Yes... but how do I tell the difference between a main page and a frame page, then?
|
|
01-18-2010 05:52 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [help] InternetExplorer Object events...
Can you not get the url from the browser object?
|
|
01-18-2010 05:54 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|