For expert of WEB language or perhaps FRED itself

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

For expert of WEB language or perhaps FRED itself

Post by Kwai chang caine »

Hello at all

I have try a code with the GREAT COMATE to use JavaScript :D

But i have a problem, who just someone with much knowledge of the WEB can answered i think.
Or obvioustly the creator FRED or FREAK

If FRED answered to me, i certify that i don't make another picture of my god and also no prostration before him for this time :(

And here before all the familly !!!
I certify, i certify....spit and sworn, if i lie.......... i go to the hell
:?

The WEB is so another world :roll:

So i use this code, who is see by SROD itself (Yes yes !!! Itself 8) )

Code: Select all

;///////////////////////////////////////////////////////////////////////////////// 
;***COMate***  COM automation through iDispatch. 
;*=========== 
;* 
;*Execute JavaScript in WebGadget demo by Timo Harter (Freak), Ricardo and Stephen Rodriguez. 
;///////////////////////////////////////////////////////////////////////////////// 

IncludePath "..\" 
XIncludeFile "COMate.pbi" 

Enumeration 
 #FormWeb 
 #WebGadget 
 #IEExplorer 
EndEnumeration 

Define.COMateObject WebObject 
Global WebObjectWait.COMateObject 
Global HTTPObject.COMateObject 

Procedure.i ExecuteJavaScript(Command$) 

 Protected DocumentDispatch.COMateObject, Script.COMateObject 
 Protected Result 

 If HTTPObject 
  
  DocumentDispatch = HTTPObject\GetObjectProperty("Document") 
  
  If DocumentDispatch 
    Script = DocumentDispatch\GetObjectProperty("script") 
    
    If Script 
     Result = Script\Invoke("eval('" + command$ + "')") 
     Script\release() 
    EndIf  
    
    DocumentDispatch\Release() 
  
  EndIf 
    
 EndIf 
  
 ProcedureReturn Result 
  
EndProcedure 
  
Procedure LoopWait() 
  
 WebObjectWait = COMate_WrapCOMObject(GetWindowLong_(GadgetID(#WebGadget), #GWL_USERDATA)) 
 Status = - 1 
  
 If WebObjectWait 
  
  While Status 
    While WindowEvent():Delay(1):Wend 
    Status = WebObjectWait\GetIntegerProperty("Busy") 
  Wend 
  
  WebObjectWait\Release() 
  
 EndIf 
  
EndProcedure 

Procedure OuvreClientWeb(Url.s, Client = #IEExplorer) 
  
 If Client = #WebGadget 
  
  If IsGadget(Client) 
  
   HTTPObject = COMate_WrapCOMObject(GetWindowLong_(GadgetID(Client), #GWL_USERDATA)) 
   SetGadgetText(Client, Url) 
   LoopWait()    
    
  EndIf 
    
 ElseIf #IEExplorer 
    
  HTTPObject = COMate_CreateObject("InternetExplorer.Application") 
  
  If HTTPObject 
    
   HTTPObject\SetProperty("Visible= #True") 
   HTTPObject\invoke("Navigate('" + Url + "')") 
    
   While Status$ <> "Done" 
    Status$ = HTTPObject\GetStringProperty("StatusText") 
    Delay(10) 
   Wend 
    
   Delay(1000) 
    
  EndIf 
  
 EndIf 

EndProcedure 


OpenWindow(#FormWeb, 0, 0, 800, 600, "", #PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered) 
WebGadget(#WebGadget, 10, 10, WindowWidth(#FormWeb) - 20, WindowHeight(#FormWeb) - 60, "") 

; First method with webgadget 
;OuvreClientWeb("http://www.purebasic.fr/english/posting.php?mode=reply&t=33983", #WebGadget) 
;xMessage$ = "Hello from PB :)" 
;ExecuteJavaScript("document.all.message.value=" + Chr(34) + xMessage$ + Chr(34)) 
;ExecuteJavaScript("document.all.preview.click()") 

; Second method with IE client 
 OuvreClientWeb("http://www.purebasic.fr/english/posting.php?mode=reply&t=33983", #IEExplorer) 
xMessage$ = "Hello from PB :)" 
ExecuteJavaScript("document.all.message.value=" + Chr(34) + xMessage$ + Chr(34)) 
ExecuteJavaScript("document.all.preview.click()") 

    
Repeat  
 Evenement = WaitWindowEvent() 
Until Evenement = #PB_Event_CloseWindow 

HTTPObject\Release() 
End 
But my problem is, that in my job, i have some internal site in java script
And obviously a crap of proxy :?
And i want acceed at this site with WebGadget or IE client

When i open this site with WebGadget that's works fine :D
I close the program, i open with IE client....and nothing :shock:

Well i close the program another time, i open the site with WebGadget, that's works fine too, normal
I don't close the webgadget, and i open the IE client in the same time...and now .......cherry on the cake.....the IE works :shock: :shock:

It's more strong that the strong cheese, no ??? :?
Like if the WebGadget open the way to IE client or perhaps keep rights for IE :shock:

ATTENTION !!!!
This events just come with internal site.
At the begining, i believe it's the fault of HTTPS :roll:
But no, because i have try this code with EBay and my personal account.
And that's works :?

Then my question of the year is

Vloouuuu vlouuuu vlouuuu !!! (Roll of drum)

What is the difference between IE and WebGadget ??? :roll:
I believe it's the same thing, but this event proof that it's wrong.

What have WebGadget that IE don't have ???? :roll:

I'm not so "normal".....i agree that :oops:
But this time.....i believe i go to be crazy again more :lol:

Thanks for to have read my problem
Good day
ImageThe happiness is a road...
Not a destination
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

What have WebGadget that IE don't have ????

IE has many "options" that may be set differently than the webgadget.

I'm not sure this is the case, but I've run across it in my programs several times.

cheers
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Don't worry, IE vs Webgadget behavior has many of us confused as well.

Even though the Webgadget uses IE components, there are differences in how/what it's allowed or able to do.

Something about security context maybe, the WebGadget is not an actual web browser although it does behave like it is usually.

Another issue I haven't tested yet is WebGadget vs IE7 which runs in s sandbox mode on Vista, I have no idea if the Webgadget is also in the same sandbox mode or not.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Thanks at you two for your quick answer 8)
rsts wrote:What have WebGadget that IE don't have ????
IE has many "options" that may be set differently than the webgadget.
I'm not sure this is the case, but I've run across it in my programs several times.
Rescator wrote:Even though the Webgadget uses IE components, there are differences in how/what it's allowed or able to do.
Something about security context maybe, the WebGadget is not an actual web browser although it does behave like it is usually.
I'm happy too see, that i'm not alone too see this thing :D

But i have test when even a thing before create this thread.
I have modify the option JAVASCRIPT in the IE
I have set it on "no script"
Then the webgadget don't allow SCRIPT too

I say to me : "The parameter of IE is also the parameter of WebGadget"

But you have perhaps right, another parameter of IE is perhaps not use in WebGadget.....but what is it ?????
There are so much parameter in IE :?

Only the Pure TEAM perhaps can know the real difference :roll:

SROD have the kindness to give to me a new code for test on my job.
But only monday i can test it :cry:

Perhaps, i have another idea or mind of members between now and monday ???

So thanks again for have give to me your opinion 8)
ImageThe happiness is a road...
Not a destination
Post Reply