WebView.ewo - how to handle js exceptions

Find and share HowTos to various installations / configurations!
5 posts • Page 1 of 1
treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

WebView.ewo - how to handle js exceptions

Post by treshnikov »

Hello,

How can I get unhandled js exceptions?
I try to show web site (http://gate-er.sms-samara.ru:8080/kamges) inside mimic panel - by using WebView.ewo.

This website works perfectly in IE11 and Chrome, but does not work in WebView.ewo.

treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

Re: WebView.ewo - how to handle js exceptions

Post by treshnikov »

The problem was connected with javascript. My site uses "window.localStorage" object for storing user data, but WebView.ewo cannot access to localStorage in default implementation.

It was very difficult to find out the reason of failure, because WebView.ewo does not provide any debug information.

Can you send me source files for Qt project WebView.ewo?
I going to to extend default behavior of WebView.ewo - to add localstorage option and to enable debugging information.

Code: Select all

QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
I tried to build new plugin with QWebView's component and to define needed options, but got many errors during compilation process. That why I ask you to send me source files for WebView.ewo Qt project.

Also I going to define scenario for file downloading. Current implementation of QWebView does not have this option "from the box".

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: WebView.ewo - how to handle js exceptions

Post by mkoller »

Get in contact with our support. They can send you the (very trivial) ewo sources. But as an EWO is just a thin wrapper around a Qt Widget, you should be able to also do this on your own.
You said, you got compilation errors. Which ?

treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

Re: WebView.ewo - how to handle js exceptions

Post by treshnikov »

C:\\Siemens\\Automation\\WinCC_OA\\3.12\\api\\build-EwoTestPlugin-qt_4_8_x64-Debug\\release\\moc_BaseExternWidget.cpp:68: ??????: C2491: 'BaseExternWidget::staticMetaObjectExtraData' : definition of dllimport static data member not allowed

C:\\Siemens\\Automation\\WinCC_OA\\3.12\\api\\build-EwoTestPlugin-qt_4_8_x64-Debug\\release\\moc_BaseExternWidget.cpp:72: ??????: C2491: 'BaseExternWidget::staticMetaObject' : definition of dllimport static data member not allowed

treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

Re: WebView.ewo - how to handle js exceptions

Post by treshnikov »

Martin, thank a lots!

Now plugin works fine and WinCC OA can properly load and display my extension.

What steps I've done:
* Get Qt Creator
* Get Qt 4.8 x64 for Visual Studio 2013 (http://tver-soft.org/qt64)
* In project add API_ROOT = "C:\\Siemens\\Automation\\WinCC_OA\\3.12\\api"
* Copy dll from output project directory to bin\\widgets
* Rename .dll >> .ewo

The problem was connected with two last three.

5 posts • Page 1 of 1