PB 5.41LTS Web Gadget Issues

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

PB 5.41LTS Web Gadget Issues

Post by IdeasVacuum »

PB 5.41LTS Windows 7 x86 IE 11.0.9600.18097

1) If I use the WebGadget to display Google Maps, the Google page pops-up a message:
It looks like you have enabled Internet Explorer Compatibility View. Google Maps will not work correctly unless this is turned off.
This, however, is not true, Compatibility View is not set, and if I use IE stand-alone, the message is not displayed, so it would seem the WebGadget itself triggers this somehow.

2) The WebGadget has issues with some JavaScript and pops-up error messages, e.g: http://www.theaa.com/
An error has occurred in the script on this page.
Line: 1
Char: 29674
Error: Permission denied
Code: 0
URL: http://www.theaa.com/resources/js/homep ... ary.min.js
....yet I do not get any such errors in IE (or FireFox)

Has anybody seen similar issues?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: PB 5.41LTS Web Gadget Issues

Post by RASHAD »

Works like a charm
PB 5.41 x86 Win 10 x64

Code: Select all

  If OpenWindow(0, 0, 0, 1920, 1200, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    WebGadget(0, 10, 10, 1900, 1180, "http://www.theaa.com/resources/js/homepage")
    myBrowser.IWebBrowser2 = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA)
    myBrowser\put_Silent(#True)
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
Egypt my love
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.41LTS Web Gadget Issues

Post by IdeasVacuum »

Hi Rashad

Not like the Win8.1 charms fortunately :mrgreen:

....still a problem though. When the WebGadget has an issue with JavaScript, your code suppresses the error message pop-ups, which is great, but the display/functionality of the website is not 100% correct without the JavaScript working properly.

....Google Maps does fail to display properly, so it seems that the WebGadget triggers IE Compatibility View.

Could a Moderator move this to the Bugs section please?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: PB 5.41LTS Web Gadget Issues

Post by Bisonte »

Is the webgadget really use IE 11.0.9600.18097 ?

If you don't change something in the registry, it will use another version...
Check it with http://www.whatismybrowser.com/

I think it's the "Internet Explorer 7 Compatibility View, 32 bit compatibility layer, Media Center PC v6.0"...

More at german forum
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.41LTS Web Gadget Issues

Post by IdeasVacuum »

That's interesting Bisonte
www.whatismybrowser.com reports:
Internet Explorer 11 on Windows 7
Internet Explorer 7 Compatibility View
Your web browser's user agent:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0; GWX:RESERVED)
I'm totally confused though. I thought PB was using WebKit for all platforms and I had assumed that WebKit was itself independent of the standalone browsers.

Fact remains that the javascript and IE Compatibility View issues arrive with the PB WebGadget and are not there when I.E, FireFox or Opera are used.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
JHPJHP
Addict
Addict
Posts: 2273
Joined: Sat Oct 09, 2010 3:47 am

Re: PB 5.41LTS Web Gadget Issues

Post by JHPJHP »

Hi IdeasVacuum,

Try the following:

Code: Select all

lpValueName.s = GetFilePart(ProgramFilename()) : lpData = 11001

If RegCreateKeyEx_(#HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", 0, #Null, #REG_OPTION_VOLATILE, #KEY_ALL_ACCESS, #Null, @phkResult, @lpdwDisposition) = #ERROR_SUCCESS
  RegSetValueEx_(phkResult, lpValueName, 0, #REG_DWORD, @lpData, SizeOf(LONG))
  RegCloseKey_(phkResult)

  If OpenWindow(0, 0, 0, 1920, 1200, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    WebGadget(0, 10, 10, 1900, 1180, "http://www.theaa.com/resources/js/homepage")
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

  If RegOpenKeyEx_(#HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", 0, #KEY_SET_VALUE, @phkResult) = #ERROR_SUCCESS
    RegDeleteValue_(phkResult, lpValueName)
    RegCloseKey_(phkResult)
  EndIf
EndIf
Additional setting:

Code: Select all

SetGadgetAttribute(0, #PB_Web_BlockPopupMenu, #True)
SetGadgetAttribute(0, #PB_Web_BlockPopups, #True)
WebBrowser2.IWebBrowser2 = GetWindowLongPtr_(GadgetID(0), #GWL_USERDATA)
WebBrowser2\put_Silent(#True)

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.41LTS Web Gadget Issues

Post by IdeasVacuum »

Hi JHPJHP

The Registry edit does fix the Goggle Maps issue, but doesn't the app User have to be Administrator?
Concerning the script error suppression, that is not a solution, it just removes the symptoms! :D

I'm thinking about launching (RunProgram) the default browser instead, or a mini browser such as midori
What can be done is limited compared to the embedded WebGadget, but at least it is reliable.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: PB 5.41LTS Web Gadget Issues

Post by Dude »

IdeasVacuum wrote:The Registry edit does fix the Goggle Maps issue, but doesn't the app User have to be Administrator?
No, writing to #HKEY_CURRENT_USER can be done with limited rights (any logged-in user).
Post Reply