ngergo6
ngergo6

Reputation: 267

MediaWiki: Javascripts do not run in embedded browsers, runs fine in normal browsers

I need to display a MediaWiki page that our company hosts inside an application's embedded Internet Explorer control.
I am trying to run a custom script inside my MediaWiki skin's javascript file to adjust the layout dynamically but I found out that the script runs perfectly inside every browser instead of the embedded IE. I've tried putting an alert at the beginning of the script, it showed up in Chrome, FF, Internet Explorer, but not in the embedded IE control.

The application is written in Delphi, which I'm not an expert of so I created a small WPF application with a WebBrowser component and the results are the same: the script is not running.

I also tried to put my logic into the MediaWiki:Common.js page but that doesn't run either.

Any help or pointing me into the right direction would be appreciated. Thanks

Upvotes: 0

Views: 90

Answers (3)

graza
graza

Reputation: 383

I ran into this problem in a Delphi application. Turns out that the embedded control defaults to IE7 compatibility mode. You can put entries in the registry to convince IE otherwise.

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

I added a new DWORD value with the name set to my application (e.g. myapp.exe) and set it to 0x2fa9.

Upvotes: 0

ngergo6
ngergo6

Reputation: 267

It turned out IE had separate security settings for embedded browsers, this is was prevented the script from running. The solution was to allow the running of scripts or add the site which I wanted to display to the trusted sites.
This is obviously not a good solution since I can't expect all the clients to alter their security settings so the IE engine was changed to Chrome in the Delphi application.

Upvotes: 1

Nemo
Nemo

Reputation: 2544

Some JavaScript features in MediaWiki are disabled for Internet Explorer (sometimes any version, often up to IE8). In MediaWiki 1.24, JavaScript is disabled altogether for IE7 or lower. https://www.mediawiki.org/wiki/MediaWiki_1.24#Browser_support_deprecated_or_removed

So, what version of Internet Explorer are you talking about? That might not be your problem, but the fact that you didn't mention the version makes me think you probably neglected to check its support level.

Upvotes: 0

Related Questions