WebGadget flag to hide error popups

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

WebGadget flag to hide error popups

Post by PB »

Currently the WebGadget supports only one single flag, but I'd like to suggest
another: #PB_Web_HideErrors. Purpose: Suppress JavaScript error messages.
Sometimes when showing content in a WebGadget, you will get this gem:

Image

So, to avoid this pop-up error message, I've been adding this code to my WebGadgets:

Code: Select all

WebGadget(#MyWebGadget,4,4,478,247,"")
  MyWebGadget.IWebBrowser2=GetWindowLong_(GadgetID(#MyWebGadget),#GWL_USERDATA)
  MyWebGadget\put_Silent(#True) ; Suppress JavaScript error messages.
It'd be nice just to do this instead, to save all that extra typing:

Code: Select all

WebGadget(#MyWebGadget,4,4,478,247,"",#PB_Web_HideErrors)
Also, I know you can suppress right-clicks with #PB_Web_BlockPopupMenu via
SetGadgetAttributes(), but it'd be nice to do it all one declaration, too:

Code: Select all

WebGadget(#MyWebGadget,4,4,478,247,"",#PB_Web_HideErrors|#PB_Web_BlockPopupMenu)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: WebGadget flag to hide error popups

Post by PB »

Had a different pop-up today at work with my WebGadget, which my snippet
above in the original post doesn't prevent. See below. Anyone know how to
prevent this one from appearing? :(

Image
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Both those error messages means you have installed some kind of debugger (happens when you install Visual Studio or similar). Normal users will see a third type of error message:
Image

Just so you are warned.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

So the snippet I posted doesn't stop the popup that you just showed?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I don't know.
Edit: oh it does.
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: WebGadget flag to hide error popups

Post by jesperbrannmark »

no that normal user message still popup - so we dont supress any "errors" (what is a error to IE is not what is a error to the rest of the world)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: WebGadget flag to hide error popups

Post by IdeasVacuum »

It is an issue, seems there is a lot of incompatibility with javascript. Suppress the messages yes. Better web engine for Windows, yes yes.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply