MASM - Find browser window title? - winapi

I have a Webbrowser implemented into my application, is there any way to find the title of the currently loaded document in the Webbrowser ?
What I am trying to achieve is that the browser reloads the website until the document reaches a specific title.

You implemented the IE browser com object in your application ?
If so, you can get the "IHTMLDocument2" interface pointer and call the "get_title" to obtain the title string. Alternatively you can also get the html source from the "IHTMLDocument3" interface and parse it youself.
refer: Retrieve HTML source from CHtmlView (visual studio 6)

Related

Where does the ActiveX control GUID for Internet Explorer web browser come from?

I've noticed that a few ActiveX-based webviews leveraging web browser control through the following GUID
Web Browswer Control - 8856F961-340A-11D0-A96B-00C04FD705A2
that GUID shows up in some Microsoft pages such as this, and it also shows up in a few StackOverflow questions. However, I wasn't able to find the source of truth regarding that GUID and also any reference ho how to use it.
With that in mind, does anyone know where the web browser control GUID come from? And is there any guide on how to use it?
It is CLSID_WebBrowser which is a COM class that implements the IWebBrowser2 interface. This is essentially Internet Explorer.
The definition is in ExDisp.Idl in the Windows SDK.
To use it, call CoCreateInstance like you would on any other COM object. In something higher level like Visual Basic or WSH, use Set IE = CreateObject("InternetExplorer.Application").
See also:
Embed an HTML control in your own window using plain C

How to display popup with html in firefox bootstrapped extensions?

I developed a firefox bootstrapped extension (without add-on sdk). I need to display a popup with html content, something like panel in add-on sdk. Also, it is necessary that the extension could interact with content in the popup. Also, I need a way to display html content in separate tab and interact with this content. So what can I use to implement what I need?
You can append an iframe to that panel, and then load a page into that iframe. That's what I did in this simple addon here - https://github.com/Noitidart/AwesomeBar-Power-Tip/
Here's another gist that does something similar - https://gist.github.com/Noitidart/9445992
I think this is how the SDK does it as well.
but I can not understand how it is possible to implement the interaction between expansion and content inside the panel.
The panel or its frameLoader property should have a messageManager, which can be used to load frame scripts and pass messages to them.

how to show a preference page using mozilla Add-on SDK?

I am developing an extension using the Addon-SDK. I want to show a preference page in order to get some users' configuration.
simple-prefs is too simple to use as its supported data type is so limited.
In a XUL app, I can use the following
<em:optionsType>3</em:optionsType>
<em:optionsURL>chrome://myaddon/content/options.html</em:optionsURL>
to set my preference page.
I found
the XUL migration guide
which says:
This is provided only as a migration aid, and it's still a good idea to port XUL windows to HTML.
How then can I make an HTML preference page ?
Many thanks!
I solved it in the following way:
Use simple-prefs with the preference type set to control. On its click event, open a page using the tab module, then use simple-storage to store data.
That's it!

Firefox : Difference between window, document, document.content & content

Developing an extension in Firefox and seems my mistakes are stemming from the fact that I don't understand the differences between what the below mean.
Would be great if someone could point, when exactly to use them.
Can someone who has worked with Firefox explain it please. I've added what I understand and they might very well be completely incorrect -
window
document = XUL elements + ( Web page of the current open tab)
document.content
content.document = The content of the web page of the tab open. Does not include the xul elements.
top.window.content
I'll collect the the correct explanation for the answers and put them in the question as an edit.
In an extension, document is the XUL document for the browser's UI. window is the window for that document (the object used as the script global for the chrome JS, etc). content.document is the document object for the web page in the currently selected tab. content is the window object for the web page in the currently selected tab.

How do I let a user browse HTML/WebSite content without launching the browser (need an inline browser)?

I'm creating an app on Windows Phone 7 that lets folks read offline HTML content. Is there a way to show an inline browser or HTML viewing control?
The WebBrowser control allows you to display arbitrary HTML.
There are two methods on the WebBrowser control you can use to display HTML:
Navigate() will display the contents of a file located at the supplied URL. This file can be in IsolatedStorage or on a server.
NavigateToString() will display the html string you give it.
In your case I'm guessing you'd use a WebClient object to download the webpage to offline storage, then the Navigate method to display it.
However, the benefit of NavigateToString is that you can munge the string on the way in to do some cool (or essential) stuff like style the page so it matches perfectly with the current phone theme, or catch all link clicks and make them pop in the external browser (otherwise they load in the very same WebBrowser control).
I've documented the details of styling and link clickery here.
Yes, there's a WebBrowser control in Microsoft.Phone.Controls
If you then save your (offline) files to IsolatedStorage you can then view the file via a call like this from code:
webBrowser1.Navigate(new Uri("offline-file-name.html", UriKind.Relative));
Things to note:
You can use directories within isolated storage. Just specify the whole path in the Uri.
If navigating between offline pages, all paths must be relative.

Resources