Suppress error warnings in WebGadget?

Just starting out? Need help? Post your questions and find answers here.
Seymour Clufley
Addict
Addict
Posts: 1267
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Suppress error warnings in WebGadget?

Post by Seymour Clufley »

I'm using the webgadget to load random URLs, so there's no way to know in advance if a page will have script errors.

It puts up the usual Windows error message: "This page has script errors etc"... is there any way to stop it from doing that? Or to intercept the message and press its "OK" button by code?

Thanks for any help,
Seymour.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

See if this helps...

Code: Select all

  myBrowser.IWebBrowser2 = GetWindowLong_(GadgetID(#Your_WebGadget), #GWL_USERDATA) 
  myBrowser\put_Silent(#True)  
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Seymour Clufley
Addict
Addict
Posts: 1267
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

Thanks very much for this, Sparkie. I can't report whether it works, though, because I can't find the page that was throwing up the script error! It was an MHT file, funnily enough.

But thanks again for the suggestion. I'll let you know if it works.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Sparkie wrote:See if this helps...

Code: Select all

  myBrowser.IWebBrowser2 = GetWindowLong_(GadgetID(#Your_WebGadget), #GWL_USERDATA) 
  myBrowser\put_Silent(#True)  
Works like a charm for the erroros I was getting.

Many thanks for all the effort this saved me.

cheers
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Thanks Sparkie. :) Works great here too. (I just started getting this error problem today).
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

You're welcome PB... and a belated you're welcome to Seymour and rsts. :)

I more than likely pulled that one somewhere off of Google.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re:

Post by MachineCode »

There should be an optional flag for this for the WebGadget's creation, IMO.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
ultralazor
Enthusiast
Enthusiast
Posts: 186
Joined: Sun Jun 27, 2010 9:00 am

Re: Re:

Post by ultralazor »

MachineCode wrote:There should be an optional flag for this for the WebGadget's creation, IMO.

Probably shouldn't of dug this thread up ^^

There are a lot of cross-platform parameter functions for most gadgets that are left out to expand the market of the compiler for novice users I think. AppFace for example which is sold commercially exploits this.

Some other things:
Change Agent:

Code: Select all

UrlMkSetSessionOption_($10000001,"PB Browser",Len("PB Browser"),0)
Change Refferer:

Code: Select all

browser = COMate_WrapCOMObject(GetWindowLong_(GadgetID(#web), #GWL_USERDATA))
browser\Invoke("Navigate('http://www.domain.com', #empty, '_self', #empty, '"referer: www.site.com$000d$000a"')")
Navigate() alone can set any header.

There is also a way to clear cache objects with 3 API calls and a structure. Also clear entire cache with 1 API call. Probably a way to get it to acknowledge certain headers too like No-Cache. I didn't buy PB to deal with complex structures though..
so many ideas so little time..
Post Reply