Jump to content
clubreseau

delphi Twebbrowser Javascript error

Recommended Posts

I use delphi 10.4

 

I create a button and inside I add

WebBrowser1.Navigate('https://www.aliexpress.com/');

 

to make it simple and test it. and I got a many javascript error 

 

how i can fix this. 

 

thank you

 

ror j1.thumb.png.43e3c85961371c994672a67ba0d244fe.pngj2.thumb.png.85c18c9040cbacd1608aea966dffacce.pngj3.thumb.png.0317e871659581660699f9509d5624e8.pngj4.thumb.png.33dad94120894b5f258a08ee8683d24b.png

 

Share this post


Link to post

If you really want to use TWebBrowser you must  set FEATURE_BROWSER_EMULATION before using the component (Windows is going to  remove it from the registry constantly). Of course this is only a short term solution as IE is dead.

Share this post


Link to post
1 hour ago, Lajos Juhász said:

Windows is going to  remove it from the registry constantly

To be honest, I have never heard of that, let alone experienced it myself.

 

It is still working fine, at least for the parts where have not migrated to the (fantastic!) EdgeBrowser yet.

Share this post


Link to post

For me it's happening for about a year maybe a bit longer, before that I used  the registry entry for years without a problem.

 

 

Share this post


Link to post

Add

WebBrowser1.Silent := True;

to suppress script errors.

Share this post


Link to post

To give a

WebBrowser1.Silent := True;

to suppress script errors is not a solution!!!!!

 

I have the same problem with the Delphi 11.3 sample called "WebBrowser" running on Win11. It is impossible to load a website (even bing.com!!!) without these script errors.

 

And "do not display these errors" does not prevent malfunctions of the website!!!!

 

So I'm reactivating the question, does anyone know why the Webbrowser sample is unable to play javascripts and is there a solution? Since these are samples provided by Embarcadero itself, we shouldn't even have to ask this question 😞

 

---

If anyone wonders why you insist on using delphi to display a website, I'd like to point out that the latest versions of Chrome and Edge (and maybe others) have changed their popup management, making many sites unusable without any prior announcement that I'm aware of!

 

 

Edited by Fabian1648

Share this post


Link to post
On 8/17/2022 at 10:49 PM, Lajos Juhász said:

Of course this is only a short term solution as IE is dead

Wait ... what? Didn't Bill Gates testify before Congress that IE is an "integral part of the OS" and that "Windows would not work without it?"

  • Haha 1

Share this post


Link to post
4 minutes ago, Fabian1648 said:

Do we have the same ie sources in a Windows OS 8 years ago and in Win11?

Yes, we do. Nothing has changed.

You still have two options:

  1. Set IE emulation to something newer than 2006
  2. Use an alternative from this decade (like the chromium-based WebView2 engine)
Edited by Der schöne Günther

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×