Alternative web browser implementation?

BlitzMax Forums/BlitzMax Programming/Alternative web browser implementation?

JoshK(Posted 2014) [#1]
Are there any alternative cross-platform web browser implementations for MaxGUI? The IE8 Windows one has some minor missing features, and there isn't anything I know of that works with GTKMaxGUI.


Yasha(Posted 2014) [#2]
Brucey recently wrapped Chromium Embedded Framework for Max2D. (does Max2D interact with MaxGUI?)

EDIT: hmmm no obvious link to a finished version though.


BlitzSupport(Posted 2014) [#3]
Haven't tried it, but there's a gtkwebmozilla HTMLView on Brucey's site:

http://brucey.net/programming/blitz/#bahgtkwebmozilla


markcw(Posted 2014) [#4]
You can't use the WebMozilla as it needs a library (libgtkembedmoz.so) that isn't available (or up-to-date) any more, also I think it was only for Linux. I never got it working. The other one WebGtkHtml works but not very well, no css, no http. The WebKit module is also only for Linux but it works really well, it just has problems with embedded Flash. wxMax has an HtmlView thingy which is cross-platform but I'm not sure about it, I can't remember if I got it working.


skidracer(Posted 2014) [#5]
Josh, what minor missing features are you talking about?


JoshK(Posted 2014) [#6]
Well, I think it's based on IE8 and doesn't do small things like rounded corners.

The mozilla library requires some external libs I don't know how to install. I'm probably just going to skip the Linux implementation, because once again they manage to make everything as difficult as humanly possible.


skidracer(Posted 2014) [#7]
It sounds like your html is missing doctype, which is needed when the http server end is not explicit and IE enters quirks / microtard mode.


ziggy(Posted 2014) [#8]
JoshK, IE embeded by default uses an older Trident rendering but you can enable modern IE rendering by adding a key to the windows registry for your executable .

This a overcomplicated example that shows how you could fix it (simply) http://www.codeproject.com/Articles/793687/Configuring-the-emulation-mode-of-an-Internet-Expl

Just register this:
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_BROWSER_EMULATION
                     yourapp.exe = (DWORD) version

Where version can be 9999 to set modern rendering (IE9 minimum required) and youapp.exe is just the name of the involved exe that contains the embedded browser


skidracer(Posted 2014) [#9]
ziggy, interesting... It is a pity there is not an equivalent manifest setting


JoshK(Posted 2014) [#10]
Can an application do that when UAC is turned on?


Derron(Posted 2014) [#11]
The mozilla library requires some external libs I don't know how to install. I'm probably just going to skip the Linux implementation, because once again they manage to make everything as difficult as humanly possible.


So it is the fault of linux-devs that YOU do not know how to install? I think there are people who know what it means to have the "freedom" of choice. There is no default browser installed - so you cannot guarantee that things work/exist.
Of course this also is valid for Windows - so if your app runs on a "stripped down" version of Windows (I think there exist some of them) you will run into trouble too. So the best thing is to include everything needed in your apps package - or to alert the user about missing but required programmes ("This programme needs an installed Internet explorer to display content with rounded corners").

Another idea: what stops you from just emitting a call to the system to show up a specific website - so it opens the browser the USER has installed and preselected, not the one YOU want to open.

For In-app-help you should retinker if tooltips need "html" (all other "full page" help texts could be shown in the external window - as they are surely presented in their own "tab" already, meaning the user has to switch between content-help-content or has to resize panels/windows).


Do not get me wrong, there might be some valid reasons to include a browser window in ones own app - but most of the times you will make your life easier to just redirect specific tasks to the tools the user has installed. This then also avoids problems as the one you have now (and it keeps the filesize/package-size down).


@IE8/9
So what if IE8 is installed (even if you "register" to get better rendering modes) and no update was done because the user installed FF/Chrome/old Opera... ? In these cases things will stop working the way you intended it.

If you really want to include "html rendering components" you should consider wrapping one of the freely available things (the one you got problems with) - maybe this is the more "futureproof" solution.
Did you ask for help on stackoverflow or so? There might be some more experts regarding this topic.


bye
Ron


Yasha(Posted 2014) [#12]
Please be gentle, Derron. Past experience is that this conversation escalates quickly. Which is something I'm sorry about, because it's one I'd still really like to have / someone competent to have (I for one remain genuinely baffled as to how apt, of all things, can be considered "difficult" when you're coming from OSX/Windows, neither of which have any sane mechanisms for lib installation or management at all; something must be getting lost in translation).


Can an application do that when UAC is turned on?


Shouldn't this operation be limited to install-time? The linked article suggests that it's not something you can easily change at runtime even if you have a reason to do so, so hopefully you wouldn't encounter that issue.


Derron(Posted 2014) [#13]
I did not want to sound rude ... but Josh is doing software for some time now .. and I think he had to tackle many problems ... so just giving up and returning to "not supported on linux" is imho the wrong direction.


bye
Ron


ziggy(Posted 2014) [#14]
Can an application do that when UAC is turned on?
I think so, but it is much better to do it at install time, so no worries. Most Install systems for windows (including inno setup) allow you to execute an external EXE as part of the installation process, and do so in a way that the EXE runs with administrative permissions, so you can use that to add all the required "hacking" you may need. I'm doing this for Jungle Ide so it shows documentation properly formatted (rounded tables, etc).
Doing it this way reduces distribuible package in several MiB and it is aminor change that maybe does not require you to change a single line of code in your application, and that's nice! (cheap and functional).

By the way, I agree that including any alternative browser into BlitzMax is a pain. I don't think there's an easy solution unless you migrate to Qt or JavaFX instead of BlitzMax.

so just giving up and returning to "not supported on linux" is imho the wrong direction.
Yes, but you know what they say about opinions. XD


markcw(Posted 2014) [#15]
The only properly functioning version on Linux is Webkit but you need to install libwebkitgtk-dev.


ziggy(Posted 2014) [#16]
The browser included in JavaFX is also quite good, but not exactly blitzmax compatible


JoshK(Posted 2015) [#17]
This is how you do it:
Import MaxGui.Drivers
Import "Registry.bmx"

Strict 

'Browser emulation
'https://msdn.microsoft.com/en-us/library/ie/ee330730%28v=vs.85%29.aspx
'IE9 emulation is the highest version compatible with Windows Vista
Function SetBrowserEmulation()
	Local key:tregkey=OpenRegKey("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION")
	If Not key key=CreateRegKey("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION")
	If key
		key.SetInt StripDir(AppFile),9999
		key.Close()
	EndIf
EndFunction

SetBrowserEmulation()

Local window:TGadget
Local htmlview:TGadget

window=CreateWindow("My Window",30,20,600,440,,15|WINDOW_ACCEPTFILES)

htmlview=CreateHTMLView(0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout htmlview,1,1,1,1 
HtmlViewGo htmlview,"http://www.google.com"

While WaitEvent()
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend



degac(Posted 2015) [#18]
Nice example, thanks!

here you can find the 'registry.bmx' file.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1991