"World's smallest Browser" and Windows XP

Just starting out? Need help? Post your questions and find answers here.
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

"World's smallest Browser" and Windows XP

Post by Lord »

Hello!

I'm wondering.
What is the reason why the web example "PureBasic\Examples\Sources\WebBrowser.pb"
doesn't work anymore using WindowsXP for some links?
It doesn't matter wether compiling with PB 5.50 or PB 5.43LTS.
It did work until last Dezember I think.
I tried

Example with link:

Code: Select all

;
; ------------------------------------------------------------
;
;   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, 500, 300, "PureBasic MiniBrowser v1.0", #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)

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

  StringGadget(4, 155, 5, 0, 20, "https://www.familysearch.org"); <--- Changed link
  
  ButtonGadget(5, 0, 0, 25, 25, "Go")
  
  FrameGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator

  If WebGadget(10, 0, 31, 0, 0, "https://www.familysearch.org") = 0; <--- Changed link
    
    CompilerIf #PB_Compiler_OS = #PB_OS_Windows
      MessageRequester("Error", "ATL.dll not found", 0)
      
    CompilerElse ; Linux and OX uses Webkit
      MessageRequester("Error", "Webkit library not found", 0)
    CompilerEndIf
    
    End ; Quit
  EndIf
  
  AddKeyboardShortcut(0, #PB_Shortcut_Return, 0)
  
  ResizeWebWindow()
  
  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))

      Case #PB_Event_SizeWindow
        ResizeWebWindow()
      
    EndSelect
      
  Until Event = #PB_Event_CloseWindow
   
EndIf
Image
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: "World's smallest Browser" and Windows XP

Post by Lunasole »

Lord wrote:Hello!

I'm wondering.
What is the reason why the web example "PureBasic\Examples\Sources\WebBrowser.pb"
doesn't work anymore using WindowsXP for some links?

Hi. That's because browser component uses Internet Explorer, and your XP probably has very old version of it installed which doesn't support lot of newer sites.
Anyway forget about that "web", it's useless and not secure
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hi Lunasol!

Thank you for answering.

Maybe in my example above the IE is the reason.

But How about this:

Code: Select all

;URL.s="http://www.purebasic.com/"
URL.s="http://familysearch.org"

InitNetwork()

*Buffer=ReceiveHTTPMemory(URL)
If *Buffer
  Result.s=PeekS(*Buffer, MemorySize(*Buffer), #PB_UTF8)
  Debug Result
  FreeMemory(*Buffer)
Else
  Debug "No result"
EndIf
This kind of code worked with all Version of Windows and PB until
the end of last year.
But some customer still using XP reported this trouble to me.
My Program didn't change. It still works with newer versions of
Windows and it is independent of wich PB version I use.
So it is definitive not a PB problem, but I have to overcome
this problem and I don't know how.
Are there any ideas what I can try?
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

But some customer still using XP reported this trouble to me.
It is most likely the version of IE that the customer is running on XP. It is simply incompatible with modern websites.
IE was very much at the end of life when XP was ditched by Microsoft. FireFox and Chrome took a huge chunk of IE customers away from MS and they have not been able to produce anything yet to win them back (Edge is not it).

On the PB side, not sure which PB Versions expect Atl.dll to be available. Also, that dll might be ASCII only?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

But isn't ReceiveHTTPMemory() based on CURL instead of IE?
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

I don't know what ReceiveHTTPMemory() is based on but I suspect the customers concerned may have been dealing with HTTP sites before, but now more sites are HTTPS and probably have measures to prevent unusual interaction.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

So the question is now: is it impossible to receive with WinXP any page that is using https?
As an example:

Code: Select all

https://das.familysearch.org/das/v2/dgs:004948415/size
In a VM here the WebGadget and ReceiveHTTPMemory() failed.
Is the only explanation for this, that the site exluded WinXP from receiving recently?
Until end of last year it worked with WinXP.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Are you 100% sure that address was not an HTTP at the end of 2016? All the people I know that have a website have been contacted by their service provider in the last few months, urging them to move on to HTTPS. So I'm sure many sites have recently changed (whether they needed to or not is another debate).

Certainly, it is becoming a disadvantage to be on WinXP if the internet is needed. As sites become more secure it might well be more difficult to pull information from them, perhaps prior permission and/or some form of official gateway being required. That's regardless of the OS a desktop app is on. BTW, I like to use FireFox but in the last 24 hours I have had two unrelated sites tell me they are designed for the Chrome browser only! It's hardly a surprise that websites are becoming more security conscious.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hi IdeasVacuum!
IdeasVacuum wrote:Are you 100% sure that address was not an HTTP at the end of 2016? ...
Yes, I just looked at my oldest available code that I used back in 2013. There is this line defining part of used link:

Code: Select all

...
Global GetFam1.s="https://das.familysearch.org/das/v2/"
...
And this line was also used in 2011, when I started to work on this specific program.
That never changed until now. It always worked for WinXP up to Win7.
Some user reported that my program also worked on Win8 to Win10, but I never tested it on these maschines.

I just need some confirmation, that this all has to do with some changes on the web site and is not a malfunction of my program.
Best would be that there is a way to get my program to work with WinXP again, so that I don't have to tell my customers, that they have to change their OS.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: "World's smallest Browser" and Windows XP

Post by IdeasVacuum »

Hi Lord
If I copy-paste into FireFox, the page is displayed as a 404. "The requested resource is not available."

However, I can access this one via FireFox:
https://das.familysearch.org/das/v2/dgs:004948415/size
The content exposed is minimal but perhaps that is what your app requires, I don't know.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><nodeSize xmlns="http://digitalarchive.familysearch.org/v1" descendantCount="728" descendantSize="1410349511" size="21640625" upToDate="true"/>
Did you see this post by GPI?
http://www.purebasic.fr/english/viewtop ... 24#p504724
Scroll to the bottom of the page to see the correct MSDN link.
I have not taken the time to even understand the information but GPI sees some potential.

I don't think you will need to ask your customers to upgrade from WinXP, though it does seem that most people now are, however reluctantly, because of the lack of updates from MS. There probably is a way for your app to continue to gather the data required but it might need some collaboration from the website owners. My only experience with this sort of requirement was the need to download money exchange rates and VAT rates (app since scrapped) - the data owners offered APIs for that task. I'm currently fleshing out the spec of a new desktop app which would be dependent on a UK Government database - publicly available on the web via their very rough access page, my app would need to be able to quickly query all of the data - nothing agreed yet but an API is being made available.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hi IdeasVacuum!
IdeasVacuum wrote:...
If I copy-paste into FireFox, the page is displayed as a 404. "The requested resource is not available."

However, I can access this one via FireFox:
https://das.familysearch.org/das/v2/dgs:004948415/size
...
Youe are right. The first URL is only a "part of used link" as I stated.
A completed link, as you used, returns the observed XML which holds the searched informations.
But this doesn't work for WinXP anymore.
IdeasVacuum wrote:...
Did you see this post by GPI?
http://www.purebasic.fr/english/viewtop ... 24#p504724
Scroll to the bottom of the page to see the correct MSDN link.
I have not taken the time to even understand the information but GPI sees some potential.
...
Yes, I did see this posting already.
But there are two drawbacks: It doesn't solve the problem and I don't need (don't want) a solution for the WebGadget but for ReceiveHTTPMemory().
IdeasVacuum wrote:...
There probably is a way for your app to continue to gather the data required but it might need some collaboration from the website owners.
...
The above link is the official API provided. No further assistance are given.
That's why I'm struggeling for alternate solutions (for WinXP).
Image
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

No further informations / suggestions / ideas on this topic? :cry:
Image
infratec
Always Here
Always Here
Posts: 6866
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: "World's smallest Browser" and Windows XP

Post by infratec »

Hi,

this works for me:

Code: Select all

InitNetwork()
IncludeFile "libcurl.pbi"

curl = curl_easy_init()
If curl
  url.s = str2curl("https://das.familysearch.org/das/v2/dgs:004948415/size")
  curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYPEER, 0)
  curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYHOST, 0)
  curl_easy_setopt(curl, #CURLOPT_HEADER, @"")
  
  curl_easy_setopt(curl,#CURLOPT_URL, @url)
  curl_easy_setopt(curl,#CURLOPT_TIMEOUT,30)
  
  curl_easy_setopt(curl,#CURLOPT_WRITEFUNCTION,@curlWriteData())
  res = curl_easy_perform(curl)
  If res = #CURLE_OK
    resData.s = curlGetData()
    ;curl_easy_getinfo(curl,#CURLINFO_RESPONSE_CODE,@resHTTP)
    ;Debug "HTTP code: " + Str(resHTTP)
    Debug "HTTP data: " + #CRLF$ + resData
  EndIf
  curl_easy_cleanup(curl)
Else
  Debug "can't init curl!"
EndIf
Results in:
HTTP/1.1 200
Content-Type: application/familysearch+xml
Content-Length: 198
Date: Sun, 26 Mar 2017 15:23:16 GMT
Connection: close

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><nodeSize xmlns="http://digitalarchive.familysearch.org/v1" descendantCount="728" descendantSize="1410349511" size="21640625" upToDate="true"/>
But you need the libcurl.pbi
Search in Tip's and Tricks.
https://github.com/deseven/pbsamples/tr ... rm/libcurl

Bernd
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: "World's smallest Browser" and Windows XP

Post by Lord »

Hello infratec!

Your code snippet worked, but....

Using this URL:
Win7, PB 5.43 LTS (X86) and PB 5.50 (x86) gives:
HTTP data:
HTTP/1.1 200
Content-Type: application/familysearch+xml
Content-Length: 198
Date: Mon, 27 Mar 2017 07:47:41 GMT
Connection: close

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><nodeSize xmlns="http://digitalarchive.familysearch.org/v1" descendantCount="728" descendantSize="1410349511" size="21640625" upToDate="true"/>
So that is OK.

But
WinXP (in VM), PB 5.43 LTS (X86) and PB 5.50 (x86) gives
(nothing) and curl_easy_perform(curl) returns 35 (wrong when connecting With SSL)

When I change the used URL to
Win7, PB 5.43 LTS (X86) and PB 5.50 (x86) now returns
HTTP data:
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://das.familysearch.org/das/v2/dgs:004948415/size
Connection: close
and

WinXP (in VM), PB 5.43 LTS (X86) and PB 5.50 (x86) also returns
HTTP data:
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://das.familysearch.org/das/v2/dgs:004948415/size
Connection: close
So in my opinion it is not possible anymore to get the needed info from that URL via SSL using WinXP.
And the URL did send that requested info regardless if http or https was used until end of last year.
It looks like there is no chance to get my program to work with WinXP again. :cry:
Image
infratec
Always Here
Always Here
Posts: 6866
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: "World's smallest Browser" and Windows XP

Post by infratec »

Hi,

you can check which dlls are required by the program on xp and try to find if these dlls are available for XP.
http://www.dependencywalker.com/

Bernd
Post Reply