Page 1 of 1

Suppress error warnings in WebGadget?

Posted: Mon Aug 27, 2007 7:53 pm
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.

Posted: Sun Sep 09, 2007 2:42 pm
by Sparkie
See if this helps...

Code: Select all

  myBrowser.IWebBrowser2 = GetWindowLong_(GadgetID(#Your_WebGadget), #GWL_USERDATA) 
  myBrowser\put_Silent(#True)  

Posted: Tue Sep 11, 2007 10:07 am
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.

Posted: Mon Oct 01, 2007 4:48 am
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

Posted: Sun Jul 20, 2008 1:49 pm
by PB
Thanks Sparkie. :) Works great here too. (I just started getting this error problem today).

Posted: Sun Jul 20, 2008 2:10 pm
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.

Re:

Posted: Sun Apr 17, 2011 10:41 pm
by MachineCode
There should be an optional flag for this for the WebGadget's creation, IMO.

Re: Re:

Posted: Mon Apr 18, 2011 11:55 am
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..