Troubles with some urls with HTMLViewer

Hi,

this is the second call for help on this matter.

On OS X, I do not have the trouble. I have it under Windows XP running on VirtualBox (now) and WIndows 8.1 in a Two-in-One laptop.

When I use this URL, everything is OK: https://comicsnostalgia.wordpress.com/page/2/

But if I try that one: http://news.google.com/newspapers?nid=wZJMF1LD7PcC&dat=19450301&printsec=frontpage&hl=en
All I get is: javascript:""

Note: the shown URLs are the ones I used. I also can use Xojo URLs for the good part, but for the bad part, I need these and I do not found other not working urls (beside these news.google.com.

Now the interface and code, because you will “need it”:

A: The interface.
I have a window (say wURL) with a TextField where I set the URL (I type it or I paste it from elsewhere [OS X, usually).
I have a main window (wMain) where the HTMLViewer control is placed.

When I press the Return key, the url is passed to the HTMLViewer: something like .LoadURL(TF_URL.Text). I close the wURL.

The wMain window is always on screen. In wMain.Activate, I have a Boolean (set to true in wURL.PB_OK) that I test and I check if the URL property is not empty, then:

HTMLViewer1LoadURL(URL_to_Go)

and I set the Boolean to False.

Why do I get my URL refused
How do I get javascript:"" set in wURL.TF_Url.Text ? (when I open the wURL window after a bunch of second of no activity ?

BTW: my project weight nearly the same as the built Stand Alone application… go figure the nightmare.

I started to build a stripped down test project and I get all kinds of troubles, one of them was the trouble some URLs… You may ask me why I do that ? Just because of the wasted monitor height with their bar, rules, URL field etc. that greatly strech the monitor height (> 130 pixels are used for that) ! When you have to make 16 or 20 screen shots to get the whole (original) image, this start to be a Goliath’s work !

PS: I create a Browser (skeleton) with minimal (those I needed) Properties and Features. One of them is Read / Write / Display / Add / Remove Bookmarks.

Also, due to my insecure feeling (on OS X !) with the IDE, I do not try to modify the project on Windows 8.1 and on Windows XP… you know why I can’t.

If I cannot get help from the forum members, I will have to start a “time as needed” debug session with an internet connection, somewhere, and I am not confident.

TIA.

BTW: I used a bit more the Mac version and found the date highlighted:

http://news.google.com/newspapers?nid=wZJMF1LD7PcC&dat=19450301&printsec=frontpage&hl=en

The date: 19450301

when I run the application on OS X and opens the wURL window (wURL.TF_URL.text).

I can disable the relevant code, but I cannot build when I have internet enabled because of the ?ºê?Ï?ƒ anti-piracy measures that prevent me to build stand alones … (I got that far before I had a second computer).

I checked, under Windows XP, if it is a matter of redirection (?) using a MediaFire link (because it can have two forms:

download/ can be replaced by ? in the URL:

http://www.mediafire.com/download/puabjom449jpby1/Popeye_-Bud_Sagendorf(200x_to_current).pdf

and

http://www.mediafire.com/?puabjom449jpby1/Popeye_-Bud_Sagendorf(200x_to_current).pdf

have the same effect: it will download the pdf.

The result is… both forms share the same results: I can see the MediaFire html page.

And if I try to decompose the “offending” URL:

http://news.google.com/newspapers?nid=wZJMF1LD7PcC&dat=19450301&printsec=frontpage&hl=en

http://news.google.com/ Works: display a news page…

http://news.google.com/newspapers Works: displays a list of newspaper

nid=wZJMF1LD7PcC This is the code for a newspaper (The Milwaukee Sentinel)
&dat= The wanted date
&printsec=frontpage I do not know, I can guess, but nothing I tried worked
&hl=en if hl=fr: the environment text will be in French. Optional.

No, seriously, I do not know what is the cause of the non functional URL.

Further testings proved that this link “works” (return the list of the available newspaper for the passed date &dat=19350801:

http://news.google.com/newspapers?nid=jOyC0gq838wC&dat=19350801

Getting the index of the available newspaper issues is great, but that is not what I create screen shots from…

Ideas ?

So there’s an issue with news.google.com URIs using the HTMLViewer only under Windows?
Have you switched the renderer to WebKit?

I just created under Windows 10 a very simple app with a textfield and an HTMLViewer that loadurl the content of the textfield when key=chr(13). Native renderer.

It displays impeccably the page you posted.

I don’t know what is this whole business of fears. The project I created on Windows 10, I transferred to Yosemite and ran it with 2014R2.1 fine. No sweat. I do that all the time back and forth for my apps which most of them are cross platform and never had any problem.

To summarize, it seems your problem may be somewhere else in your code.

HTMLvwr.xojo_binary_project

Hi Michel,

thank you for your small project.

You are correct, your project works fine and the code looks like what I used.

Look below:

This is a Windows XP screen shot. You can see the URL window (similar to your TextField) and the main window in the background.

The OK PushButton is the historical way to pass the URL to the HTMLViewer. I added the other PushButton (Set URL) for windows testing purposes and it works fine on OS X (the window is not closed, so I can send more than URL without re-opening that window.

A difference in the code is:

If Left(URL_to_Go, 7) <> "http://" Then URL_to_Go = "http://" + URL_to_Go End If

And I call the HTMLViewer directly: wMain.HTMLViewer1.LoadURL theURL

BTW: I still do not know from where the javascript:"" sentence (found in the wURL.URL.Text) comes. I do not use JavaScript / put any JavaScript in my project.

Time for some meal. I will try to check my whole project code (print it to pdf, then read the whole code) after a needed nap.

Oh: the screen shot does not display the window in FUll Screen mode.

How do you get url_to_go ? Is it your TextField Text property ? If so what I see on the screen already contains http://. So you may be ruining the URL by adding that again. I would put a system.debuglog there or a msgbox and verify what you send exactly to the HTMLViewer.

The JavaScript is probably part of the Google code.

Also, on Windows, are you using the native renderer or the native ? Could make a difference.

The variable url_to_go is filled from the TextField Text contents.

About the http:// string checking:
It comes from the docs, and it add if needed. The code works.

Windows: native renderer or native ?
I do not know: I set nothing, as far as I remember.

JavaScript:
Look at this new screen shot:

I put a MsgBox in DocumentComplete and return the sentence (Document Complete) and the url property of DocumentComplete…

The second MsgBox have the correct URL and displays the newspaper scan in the main window (large left white place on the above screen shot)

“After” the second MsgBox, I can see the whole window contents as I saw it in FireFox or…

It is time that tears off me the hair! (Systran trnaslation…)

No. Will it Help ?

Probably… Using the native renderer on Windows uses an old version of the IE engine (as documented everywhere on the internet)… I would recommend using WebKit 100% of the time…

Hi Shao,

I checked in the docs and implemented it just before your last message comes.

Note: that page HTMLViewer.Renderer is unclear. Check it with some ListBox page (Column Alignment for example).

I just generated the application and will check it right now.

The result is: IT WORKS !

Thank you ! And kudos to Michel who talks about that, but as sometimes, I skip what I read and forget it faster than I readed it.

BTW: I am making changes to a project at my local McDonald’s with all the kids noises, kitchen odors and customer commands…

[quote=139481:@Emile Schwarz]Hi Shao,

I checked in the docs and implemented it.

Note: that page is unclear. Check it with some ListBox page (Column Alignment for example).

I just generated the application and will check it right now.

The result is: IT WORKS !

Thank you ! And kudos to Michel who talks about that, but as sometimes, I skip what I read and forget it faster than I readed it.

BTW: I am making changes to a project at my local McDonald’s with all the kids noises, kitchen odors and customer commands…[/quote]

No Starbucks in Strasbourg ? Nice places for Wifi, without the burger and fries odors :wink:

Michel: I do not think so.

I only wanted to speak about how difficult it is to keep focussed on things because of the environment ! ;-:slight_smile:

On the other hand, I was goind from curious to pull hairs from my head to enthousiastic !

Arghhh, my stomak is singing its usual song ! I have to leave. More testings are left for tomorrow.

There are many Starbuck beyound the custom (in Geermany): Freiburg, etc.

After some (many) changes, it appears that the WebKit chang was the thing to do.

One more thanks to Michel and Shao for the good advice.