WebGadget Problem

Für allgemeine Fragen zur Programmierung mit PureBasic.
Benutzeravatar
udg
Beiträge: 560
Registriert: 20.06.2013 23:27

WebGadget Problem

Beitrag von udg »

Hallo Ihr,

heute habe ich festgestellt, dass aus bisher unerfindlichem Grund, nachfolgendes Webgadget nur in der PB Umgebung funktioniert.

Will heißen:

Ich rufe die Seite von Netflix in der PB IDE auf. Gehe auf Login und gebe meine Login Daten ein. Dann auf Einloggen und bin in meinem Account.

Erstelle ich nun davon eine Exe, bin abgemeldet und will mich nun über die exe einloggen, passiert rein gar nichts.
Hat dazu jemand einen Lösung parat?

Ich finde da leider keinen Ansatz

Code: Alles auswählen

;
; ------------------------------------------------------------
;
;   PureBasic - MiniBrowser
;
;    (c) Fantaisie Software
;
; ------------------------------------------------------------
;

Procedure ResizeWebWindow()
  ResizeGadget(10, #PB_Ignore, #PB_Ignore, WindowWidth(0), WindowHeight(0)-52)
  ResizeGadget(4, #PB_Ignore, #PB_Ignore, WindowWidth(0)-185, #PB_Ignore)
  ResizeGadget(5, WindowWidth(0)-25, #PB_Ignore, #PB_Ignore, #PB_Ignore)
  ResizeGadget(6, #PB_Ignore, #PB_Ignore, WindowWidth(0), #PB_Ignore)
EndProcedure


If OpenWindow(0, 100, 200, 1024, 768, "PureBasic MiniBrowser v1.0", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)

  CreateStatusBar(0, WindowID(0))
    AddStatusBarField(#PB_Ignore)
    StatusBarText(0, 0, "Welcome to the world's smallest Browser ! :)", 0)
      
  ButtonGadget(1,   0, 3, 50, 25, "Back")
  ButtonGadget(2,  50, 3, 50, 25, "Next")
  ButtonGadget(3, 100, 3, 50, 25, "Stop")

  StringGadget(4, 155, 5, 0, 20, "https://www.netflix.com")
  
  ButtonGadget(5, 0, 3, 25, 25, "Go")
  
  FrameGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator

  If WebGadget(10, 0, 31, 0, 0, "https://www.netflix.com") = 0
    
    CompilerIf #PB_Compiler_OS <> #PB_OS_Windows
      ; Linux and OX uses Webkit
      MessageRequester("Error", "Webkit library not found", 0)
    CompilerEndIf
    
    End ; Quit
  EndIf
  
  AddKeyboardShortcut(0, #PB_Shortcut_Return, 0)
  
  ; Use bindevent() to have a realtime window resize
  ;
  BindEvent(#PB_Event_SizeWindow, @ResizeWebWindow())
  ResizeWebWindow() ; Adjust the gadget to the current window size
    
  Repeat
    Event = WaitWindowEvent()
    
    Select Event
      Case #PB_Event_Gadget
      
        Select EventGadget()
          Case 1
            SetGadgetState(10, #PB_Web_Back)
          
          Case 2
            SetGadgetState(10, #PB_Web_Forward)
          
          Case 3
            SetGadgetState(10, #PB_Web_Stop)
          
          Case 5
            SetGadgetText(10, GetGadgetText(4))
            
        EndSelect      
      
      Case #PB_Event_Menu ; We only have one shortcut
        SetGadgetText(10, GetGadgetText(4))
     
    EndSelect
      
  Until Event = #PB_Event_CloseWindow
   
EndIf

PB v5.43 LTS + v6.02 LTS | Windows 7 x86 + 11 x64 - Gforce RTX 4090 - AMD Ryzen 9 5900X 12-Core Processor 4.2 GHz - 64,0 GB RAM,
ASUSTEK TUF Gaming X570 Plus
ASUS ROG Thor-1200P Platinum (1200W, Aura Sync, OLED Display, 0dB-Cooling)
1x 1 TByte Samsung MZ-V7S500BW 970 EVO Plus 1 TB NVMe M.2 Internal SSD
1x 2 TByte Samsung MZ-V7S2T0BW 970 EVO Plus 2 TB NVMe M.2 Internal SSD
von BiSONTE! TOP. Kauft Eure Hardware gern bei ihm.
Monitor:
LG 38GL950G-B 95 (38 Zoll) Ultragear Curved 21: 9 UltraWide QHD IPS
Benutzeravatar
man-in-black
Beiträge: 362
Registriert: 21.08.2006 17:39

Re: WebGadget Problem

Beitrag von man-in-black »

Hi,

hatte schonmal soetwas ähnliches. Damals hat mir der Virenscanner oder die Firewall
die Verbindung teilweise blockiert. Die PB IDE lief als Ausnahme,
wurde also ungehindert durchgelassen. Die fertige Exe jedoch nicht.
Deaktivier beides kurzzeitig mal. ;)

MFG
MIB
(hab alles, kann alles, weiß alles!!^^)

Bild
Benutzeravatar
udg
Beiträge: 560
Registriert: 20.06.2013 23:27

Re: WebGadget Problem

Beitrag von udg »

leider ohne Erfolg.

Ich habe festgestellt, wenn ich unter W7 in den Browser einen Delete Cookies Button mache, die Seite aufrufe, geht login nicht.
Dann klicke ich den Button Delete Cookies und auf einmal gehts.

Verstehe ich aber nicht :S

aus irgend einem Grund legt die Seite kein Cookie an oder kommt mit irgend etwas an den Cookies nicht klar.
PB v5.43 LTS + v6.02 LTS | Windows 7 x86 + 11 x64 - Gforce RTX 4090 - AMD Ryzen 9 5900X 12-Core Processor 4.2 GHz - 64,0 GB RAM,
ASUSTEK TUF Gaming X570 Plus
ASUS ROG Thor-1200P Platinum (1200W, Aura Sync, OLED Display, 0dB-Cooling)
1x 1 TByte Samsung MZ-V7S500BW 970 EVO Plus 1 TB NVMe M.2 Internal SSD
1x 2 TByte Samsung MZ-V7S2T0BW 970 EVO Plus 2 TB NVMe M.2 Internal SSD
von BiSONTE! TOP. Kauft Eure Hardware gern bei ihm.
Monitor:
LG 38GL950G-B 95 (38 Zoll) Ultragear Curved 21: 9 UltraWide QHD IPS
Benutzeravatar
udg
Beiträge: 560
Registriert: 20.06.2013 23:27

Re: WebGadget Problem

Beitrag von udg »

Nachtrag:

gelöst mit erstellen einer Cookie Session:

Code: Alles auswählen

WebGadget(#Webgadget, 1, 34, 1022, 714, "javascript:document.cookie='url=https://www.webpage.com'+location.href+https://www.webpage.com'; expires=expires=Fri, 31 Dec 2100 23:59:59 GMT'")
PB v5.43 LTS + v6.02 LTS | Windows 7 x86 + 11 x64 - Gforce RTX 4090 - AMD Ryzen 9 5900X 12-Core Processor 4.2 GHz - 64,0 GB RAM,
ASUSTEK TUF Gaming X570 Plus
ASUS ROG Thor-1200P Platinum (1200W, Aura Sync, OLED Display, 0dB-Cooling)
1x 1 TByte Samsung MZ-V7S500BW 970 EVO Plus 1 TB NVMe M.2 Internal SSD
1x 2 TByte Samsung MZ-V7S2T0BW 970 EVO Plus 2 TB NVMe M.2 Internal SSD
von BiSONTE! TOP. Kauft Eure Hardware gern bei ihm.
Monitor:
LG 38GL950G-B 95 (38 Zoll) Ultragear Curved 21: 9 UltraWide QHD IPS
Antworten