Quantcast
Channel: QtWebEngine
Viewing all 13965 articles
Browse latest View live

Unsolved Qt 5.12.3 QtWebEngine + QWebPage + SSL: verify server cert on client side (picture inside)

$
0
0

Hello all,

I try to check/verify (ca "identifier" info available) server cert on client side, like it pictured in step(3), in order to avoid step 4+5 (yes, I dont want send my client cert "offhandedly").
alt text
From the QWebEnginePage, there is a virtual method:

virtual bool certificateError(const QWebEngineCertificateError& err) override;

or a signal

void signal QWebEnginePage::selectClientCertificate(QWebEngineClientCertificateSelection selection)

but, nothing about incoming from step(2) server cert.
Is there any way to get info about, incoming from step(2), server cert?

this is my impl of page:

   class WebPage : public QWebEnginePage
   {
      public:
         WebPage(QObject* parent = NULL);
         virtual ~WebPage();

      protected:
         virtual bool certificateError(const QWebEngineCertificateError& err) override;

      private slots:
         void handleSelectClientCertificate(QWebEngineClientCertificateSelection selection);

      private:
         bool mState;

connect(this, &QWebEnginePage::selectClientCertificate, this, &WebPage::handleSelectClientCertificate);
   };

here is my (as solved) associated bug request about client cert handling on linux:
https://bugreports.qt.io/browse/QTBUG-71103

Thank you all.


Unsolved WebEngine from self-build Qt 5.12.4 with -webengine-proprietary-codecs fails

$
0
0

There is an issue with building Qt 5.12.4 (32 bit) with enable proprietary codecs. Linked against OpenSSL 1.1.1 installed from Qt online installer. Platform Windows 10 x64, used Visual Studio 2017 Community Edition. Additionally installed git, flex, bison, gperf, Strawberry Perl. Configured with commands:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64_x86

SET _ROOT=C:\Qt-build\qt5
SET PATH=%_ROOT%\qtbase;%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\Qt\Tools\QtCreator\bin;%PATH%;C:\Program Files\Git\usr\bin
SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET _ROOT=

SET PATH=C:\Python27;%PATH%

C:\Qt-build\qt5\configure -webengine-proprietary-codecs -shared -opensource -platform win32-msvc -nomake tests -nomake examples -confirm-license -prefix C:\Qt\5.12.4\msvc2017_32 -openssl-linked -I c:\Qt\Tools\OpenSSL\Win_x86\include -L c:\Qt\Tools\OpenSSL\Win_x86\lib OPENSSL_LIBS="libssl.lib libcrypto.lib"

After run build

nmake

Build started. And after finish run install:

nmake install
cd qtwebengine
nmake install

All build and installation without visible errors.

When I build example simplebrowseragainst Qt from C:\Qt\5.12.4\msvc2017_32 (copied SSL libs from c:\Qt\Tools\OpenSSL\Win_x86 to executable directory) it fails on start (any opening or refresh page) with message box

0_1566574508466_2019-08-23 18_25_07-Qt Simple Browser.png

Any help is appreciated.

[[qanda:topic_unsolved]] QWebEngine based deployed .exe file with console log.

$
0
0

I was using Qt 5.12.4 until I know about the new release (5.13). I am working on QWebEngine based app. In 5.12.4 when I deploy an application with release mode and run .exe file, automatic console logging window was opening and showing my logs. But in 5.13 after deploying it only opened app window itself. So how can I force my app to open console logging window with release deployed .exe file?

[[qanda:topic_unsolved]] Alternative of javaScriptWindowObjectCleared signal of QWebFrame in QtWebEngine.

$
0
0

When we create a webengine object we do add the qtObject variable in the webengine using webchannel, and then we load the url in the webengineview. Now a reload is initiated from a javascript at server side due to which the object get destroyed. We need to add the qtObject again in the webengienview on reload. How to do that?

Previously with WebKit we were using javaScriptWindowObjectCleared signal of QWebFrame for adding our qtObject.

[[qanda:topic_unsolved]] QWebEnginePage and Console-Debugging question

$
0
0

Hello,

I am using the QWebEnginePage within a QWebEngineView.

When the page is loaded (http://localhost:8081 - a local WebApp) I will get all the console messages from Chrome.
E.g. [2392:4952:0830/103609.026:INFO:CONSOLE(29)] "1567154151593", source: http://localhost:8001/ (29)

"1567154151593" is a timestamp I wrote via javascript console.log(Date.now());

I have also overwritten the javaScriptConsoleMessage function with an empty body. But this will take no effect. The messages still prints out to console. When I set a breakpoint into that function I will see the message that will be printed after exitting the function.

I also tried to set the logging by QLoggingCategory::setFilterRules("js=false");
But this takes no effect too.

Is it even possible to disable the chrome console printing?

Bye,
Tom

[[qanda:topic_unsolved]] qt5webenginecore captures application exceptions

$
0
0

Hello Sebastian,

I am seeing the same problem. The last frame on the stack after a crash points to qwebengine core

qt5\qtwebengine\src\3rdparty\chromium\base\process\memory_win.cc @ 41 but its actually capturing various other exceptions from our application.

Were you able to solve the problem?

Thanks!

[[qanda:topic_unsolved]] How to tell Qt to use my SSL DLLs on Windows

$
0
0

We are using Qt 5.12.3. We are building and including OpenSSL 1.1.0h. My customer's site is picking up OpenSSL 1.0.1h. I know it isn't picking up my DLLs, because I can delete them and it doesn't have any affect.

[[qanda:topic_unsolved]] I need to print the content of the html sub-page and how to write the code

$
0
0

In the process of developing qwebwngine, I need to call subpage printing.
parent html code

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<iframe src="print.html" id="printf" name="printf" frameborder="0" width="200"></iframe>
<input type="button" value="print child" onclick="document.getElementById('printf').contentWindow.prints();" />
</body>
</html>

child html code

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>

<body>
    <p>child page!</p>
    <div id="name">im child page!</div>
<script>
function prints(){
	window.print();
}
</script>
</body>
</html>

I need to print the content of the sub-page and how to write the code,
Do not print the buttons on the parent page.


[[qanda:topic_unsolved]] QtWebEngine signing issues

$
0
0

Re: QtWebEngine signing issues

I'm experiencing similar problems with QtWebEngine on macOS with 'Hardened runtime' enabled.
I did exactly what is suggested in this thread, but QtWebEngine still doesn't work. It doesn't seem to load and in the background QtWebEngineProcess crashes repeatedly. Below is the crash report for this, all crash reports are very similar. I'm using macOS 10.14.4 with Qt 5.9.3 (also tried 5.9.7). I tried enabling all possible entitlements for QtWebEngineProcess and it didn't help. Can anybody help or at least point out what I can try next to fix this?

Process:               QtWebEngineProcess [12723]
Path:                  /MyFolder/*/ManyCam.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
Identifier:            org.qt-project.Qt.QtWebEngineProcess
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        ManyCam [12675]
Responsible:           QtWebEngineProcess [12723]
User ID:               501

Date/Time:             2019-09-16 17:33:02.860 +0700
OS Version:            Mac OS X 10.14.4 (18E226)
Report Version:        12
Anonymous UUID:        C4FFDC66-0AA9-192B-431A-CB43347D2482


Time Awake Since Boot: 14000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrRendererMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [12723]

VM Regions Near 0x10:
--> 
    __TEXT                 0000000109e95000-0000000109e9a000 [   20K] r-x/rwx SM=COW  /MyFolder/*/ManyCam.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   org.qt-project.Qt.QtWebEngineCore	0x000000010c32fdbe v8::internal::Deoptimizer::GetDeoptimizationEntry(v8::internal::Isolate*, int, v8::internal::Deoptimizer::BailoutType, v8::internal::Deoptimizer::GetEntryMode) + 94
1   org.qt-project.Qt.QtWebEngineCore	0x000000010c3703e1 v8::internal::ExternalReferenceTable::AddDeoptEntries(v8::internal::Isolate*) + 97
2   org.qt-project.Qt.QtWebEngineCore	0x000000010c36bc02 v8::internal::ExternalReferenceTable::ExternalReferenceTable(v8::internal::Isolate*) + 210
3   org.qt-project.Qt.QtWebEngineCore	0x000000010c36bb0e v8::internal::ExternalReferenceTable::instance(v8::internal::Isolate*) + 46
4   org.qt-project.Qt.QtWebEngineCore	0x000000010c6d72d9 v8::internal::Deserializer::Deserialize(v8::internal::Isolate*) + 25
5   org.qt-project.Qt.QtWebEngineCore	0x000000010c478d46 v8::internal::Isolate::Init(v8::internal::Deserializer*) + 9878
6   org.qt-project.Qt.QtWebEngineCore	0x000000010c6dfb53 v8::internal::Snapshot::Initialize(v8::internal::Isolate*) + 723
7   org.qt-project.Qt.QtWebEngineCore	0x000000010bfbdf09 v8::Isolate::New(v8::Isolate::CreateParams const&) + 361
8   org.qt-project.Qt.QtWebEngineCore	0x000000010bf8750c gin::IsolateHolder::IsolateHolder(gin::IsolateHolder::AccessMode) + 284
9   org.qt-project.Qt.QtWebEngineCore	0x000000010d2e9cbf blink::V8PerIsolateData::V8PerIsolateData() + 31
10  org.qt-project.Qt.QtWebEngineCore	0x000000010d2ea382 blink::V8PerIsolateData::initialize() + 34
11  org.qt-project.Qt.QtWebEngineCore	0x000000010d2e38cb blink::V8Initializer::initializeMainThread() + 107
12  org.qt-project.Qt.QtWebEngineCore	0x000000010d267ac4 blink::initialize(blink::Platform*) + 20
13  org.qt-project.Qt.QtWebEngineCore	0x000000010cedc97e content::RenderThreadImpl::InitializeWebKit(scoped_refptr<base::SingleThreadTaskRunner>&) + 174
14  org.qt-project.Qt.QtWebEngineCore	0x000000010cedaecc content::RenderThreadImpl::Init(scoped_refptr<base::SingleThreadTaskRunner>&) + 300
15  org.qt-project.Qt.QtWebEngineCore	0x000000010ceda65a content::RenderThreadImpl::RenderThreadImpl(std::__1::unique_ptr<base::MessageLoop, std::__1::default_delete<base::MessageLoop> >, std::__1::unique_ptr<blink::scheduler::RendererScheduler, std::__1::default_delete<blink::scheduler::RendererScheduler> >) + 1434
16  org.qt-project.Qt.QtWebEngineCore	0x000000010ceda07c content::RenderThreadImpl::Create(std::__1::unique_ptr<base::MessageLoop, std::__1::default_delete<base::MessageLoop> >, std::__1::unique_ptr<blink::scheduler::RendererScheduler, std::__1::default_delete<blink::scheduler::RendererScheduler> >) + 76
17  org.qt-project.Qt.QtWebEngineCore	0x000000010cf0b165 content::RendererMain(content::MainFunctionParams const&) + 517
18  org.qt-project.Qt.QtWebEngineCore	0x000000010aa395b5 content::ContentMainRunnerImpl::Run() + 437
19  org.qt-project.Qt.QtWebEngineCore	0x000000010aa38976 content::ContentMain(content::ContentMainParams const&) + 54
20  org.qt-project.Qt.QtWebEngineCore	0x0000000109ee2e36 QtWebEngine::processMain(int, char const**) + 70
21  org.qt-project.Qt.QtWebEngineProcess	0x0000000109e99f54 0x109e95000 + 20308
22  libdyld.dylib                 	0x00007fff7e1433d5 start + 1

Thread 1:
0   libsystem_pthread.dylib       	0x00007fff7e3303f0 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	0x00007fff7e3303f0 start_wqthread + 0

Thread 3:: Dispatch queue: com.apple.root.utility-qos.overcommit
0   com.apple.CoreFoundation      	0x00007fff51bf8fae __CFStringCreateImmutableFunnel3 + 1472
1   com.apple.CoreFoundation      	0x00007fff51bfffec CFStringCreateWithBytes + 27
2   com.apple.CoreServicesInternal	0x00007fff662f8653 BookmarkData::copyItem(CFBookmarkDataItem const*, unsigned long) const + 1333
3   com.apple.CoreServicesInternal	0x00007fff662f8115 copyIndexedPathComponent(BookmarkData&, unsigned int, unsigned int) + 109
4   com.apple.CoreServicesInternal	0x00007fff662f7d9c copyPathComponentsAsString(BookmarkData&, unsigned int, int, bool) + 390
5   com.apple.CoreServicesInternal	0x00007fff662f7bb5 returnPathComponentsAsString(BookmarkData&, unsigned int, unsigned long long) + 26
6   com.apple.CoreServicesInternal	0x00007fff662f7b33 BookmarkCopyPropertyFromBookmarkData(BookmarkData&, __CFString const*, unsigned long) + 100
7   com.apple.CoreServicesInternal	0x00007fff662f7948 _CFURLCreateResourcePropertiesForKeysFromBookmarkData + 241
8   com.apple.CoreFoundation      	0x00007fff51c88380 +[NSURL resourceValuesForKeys:fromBookmarkData:] + 25
9   com.apple.LaunchServices      	0x00007fff53226aed +[FSNode(BookmarkData) pathForBookmarkData:error:] + 114
10  com.apple.LaunchServices      	0x00007fff532269ff +[FSNode(BookmarkData) nameForBookmarkData:error:] + 37
11  com.apple.LaunchServices      	0x00007fff5328c272 invocation function for block in int __FSNODE_BRIDGE_TO_CF__<__CFString const, __CFData const*>(objc_selector*, __CFString const**, __CFData const*) + 57
12  com.apple.LaunchServices      	0x00007fff532268da FSNodeBookmarkDataCopyName + 114
13  com.apple.LaunchServices      	0x00007fff532262f5 _LSAliasCompareToNode + 184
14  com.apple.LaunchServices      	0x00007fff5322611a _LSBundleMatchesNode(LSDatabase*, unsigned int, LSBundleData const*, FSNode*, unsigned long long) + 189
15  com.apple.LaunchServices      	0x00007fff53225cff _LSBundleFindWithNode + 817
16  com.apple.LaunchServices      	0x00007fff53227f65 _LSFindOrRegisterBundleNode + 163
17  com.apple.LaunchServices      	0x00007fff532437cf getAppBundleIdentifierVersionAndCapabilityFlags(_LSOnDemandContext&, FSNode*, unsigned int, NSString* __autoreleasing*, unsigned long long*, unsigned char*, NSError* __autoreleasing*) + 108
18  com.apple.LaunchServices      	0x00007fff5324343a prepareApplicationCapabilityIsDisabledValue(_LSOnDemandContext&, FSNode*, __CFString const*, unsigned int, __FileCache*, __CFString const*, NSError* __autoreleasing*) + 210
19  com.apple.LaunchServices      	0x00007fff53243363 prepareApplicationNapIsDisabledValue(_LSOnDemandContext&, FSNode*, __FileCache*, __CFString const*, NSError* __autoreleasing*) + 33
20  com.apple.LaunchServices      	0x00007fff532105c6 LSPropertyProviderPrepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) + 657
21  com.apple.CoreServicesInternal	0x00007fff662e80ee prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) + 360
22  com.apple.CoreServicesInternal	0x00007fff662e9d3d _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) + 214
23  com.apple.CoreFoundation      	0x00007fff51c3a767 CFURLCopyResourcePropertyForKey + 101
24  com.apple.CoreFoundation      	0x00007fff51c8d009 ____CFRunLoopSetOptionsReason_block_invoke_5 + 154
25  libdispatch.dylib             	0x00007fff7e0f55f8 _dispatch_call_block_and_release + 12
26  libdispatch.dylib             	0x00007fff7e0f663d _dispatch_client_callout + 8
27  libdispatch.dylib             	0x00007fff7e104654 _dispatch_root_queue_drain + 988
28  libdispatch.dylib             	0x00007fff7e104b46 _dispatch_worker_thread2 + 90
29  libsystem_pthread.dylib       	0x00007fff7e3306b3 _pthread_wqthread + 583
30  libsystem_pthread.dylib       	0x00007fff7e3303fd start_wqthread + 13

Thread 4:
0   libsystem_pthread.dylib       	0x00007fff7e3303f0 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	0x00007fff7e3303f0 start_wqthread + 0

Thread 6:: Chrome_ChildIOThread
0   libsystem_kernel.dylib        	0x00007fff7e27bf4a write + 10
1   org.qt-project.Qt.QtWebEngineCore	0x000000010a72c6fd mojo::edk::PlatformChannelWrite(mojo::edk::PlatformHandle, void const*, unsigned long) + 45
2   org.qt-project.Qt.QtWebEngineCore	0x000000010be12724 mojo::edk::(anonymous namespace)::ChannelPosix::WriteNoLock(mojo::edk::(anonymous namespace)::MessageView) + 260
3   org.qt-project.Qt.QtWebEngineCore	0x000000010be112e4 mojo::edk::(anonymous namespace)::ChannelPosix::Write(std::__1::unique_ptr<mojo::edk::Channel::Message, std::__1::default_delete<mojo::edk::Channel::Message> >) + 132
4   org.qt-project.Qt.QtWebEngineCore	0x000000010be213dc mojo::edk::NodeChannel::WriteChannelMessage(std::__1::unique_ptr<mojo::edk::Channel::Message, std::__1::default_delete<mojo::edk::Channel::Message> >) + 204
5   org.qt-project.Qt.QtWebEngineCore	0x000000010be21bbd mojo::edk::NodeChannel::PortsMessage(std::__1::unique_ptr<mojo::edk::Channel::Message, std::__1::default_delete<mojo::edk::Channel::Message> >) + 29
6   org.qt-project.Qt.QtWebEngineCore	0x000000010be293a0 mojo::edk::NodeController::SendPeerMessage(mojo::edk::ports::NodeName const&, std::__1::unique_ptr<mojo::edk::ports::Message, std::__1::default_delete<mojo::edk::ports::Message> >) + 448
7   org.qt-project.Qt.QtWebEngineCore	0x000000010be298f8 mojo::edk::NodeController::ForwardMessage(mojo::edk::ports::NodeName const&, std::__1::unique_ptr<mojo::edk::ports::Message, std::__1::default_delete<mojo::edk::ports::Message> >) + 104
8   org.qt-project.Qt.QtWebEngineCore	0x000000010a731fe3 mojo::edk::ports::Node::OnObserveProxy(mojo::edk::ports::PortName const&, mojo::edk::ports::ObserveProxyEventData const&) + 515
9   org.qt-project.Qt.QtWebEngineCore	0x000000010a7319b3 mojo::edk::ports::Node::AcceptMessage(std::__1::unique_ptr<mojo::edk::ports::Message, std::__1::default_delete<mojo::edk::ports::Message> >) + 227
10  org.qt-project.Qt.QtWebEngineCore	0x000000010be268a0 mojo::edk::NodeController::AcceptIncomingMessages() + 240
11  org.qt-project.Qt.QtWebEngineCore	0x000000010be2ac1e mojo::edk::NodeController::OnPortsMessage(mojo::edk::ports::NodeName const&, std::__1::unique_ptr<mojo::edk::Channel::Message, std::__1::default_delete<mojo::edk::Channel::Message> >) + 286
12  org.qt-project.Qt.QtWebEngineCore	0x000000010be22f7b mojo::edk::NodeChannel::OnChannelMessage(void const*, unsigned long, std::__1::unique_ptr<std::__1::vector<mojo::edk::PlatformHandle, std::__1::allocator<mojo::edk::PlatformHandle> >, mojo::edk::PlatformHandleVectorDeleter>) + 2203
13  org.qt-project.Qt.QtWebEngineCore	0x000000010be10b82 mojo::edk::Channel::OnReadComplete(unsigned long, unsigned long*) + 466
14  org.qt-project.Qt.QtWebEngineCore	0x000000010be11ec1 mojo::edk::(anonymous namespace)::ChannelPosix::OnFileCanReadWithoutBlocking(int) + 337
15  org.qt-project.Qt.QtWebEngineCore	0x000000010aac268e base::MessagePumpLibevent::OnLibeventNotification(int, short, void*) + 190
16  org.qt-project.Qt.QtWebEngineCore	0x000000010afce8e5 event_base_loop + 1269
17  org.qt-project.Qt.QtWebEngineCore	0x000000010aac297f base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 463
18  org.qt-project.Qt.QtWebEngineCore	0x000000010aac00ee base::MessageLoop::RunHandler() + 94
19  org.qt-project.Qt.QtWebEngineCore	0x000000010aae4511 base::RunLoop::Run() + 113
20  org.qt-project.Qt.QtWebEngineCore	0x000000010ab1834b base::Thread::ThreadMain() + 299
21  org.qt-project.Qt.QtWebEngineCore	0x000000010ab11647 base::(anonymous namespace)::ThreadFunc(void*) + 87
22  libsystem_pthread.dylib       	0x00007fff7e3312eb _pthread_body + 126
23  libsystem_pthread.dylib       	0x00007fff7e334249 _pthread_start + 66
24  libsystem_pthread.dylib       	0x00007fff7e33040d thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x000000000000000a
  rdi: 0x00007f860e819800  rsi: 0x0000000000000000  rbp: 0x00007ffee5d69240  rsp: 0x00007ffee5d69220
   r8: 0x0000000000000000   r9: 0x0000000000008018  r10: 0x0000000000000000  r11: 0x0000000000000158
  r12: 0x000000010e700cc9  r13: 0x00007ffee5d69810  r14: 0x0000000000000001  r15: 0x00007f860e819800
  rip: 0x000000010c32fdbe  rfl: 0x0000000000010206  cr2: 0x0000000000000010
  
Logical CPU:     3
Error Code:      0x00000004
Trap Number:     14


Binary Images:
       0x109e95000 -        0x109e99ff3 +org.qt-project.Qt.QtWebEngineProcess (0) <46F5E17A-1688-365C-9842-F245421974A8> /MyFolder/*/ManyCam.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
       0x109ea4000 -        0x10ee9af27 +org.qt-project.Qt.QtWebEngineCore (5.9 - 5.9.3) <9E7F07AE-13D8-3915-8BB5-CE52EA56FA0F> /MyFolder/*/ManyCam.app/Contents/Frameworks/QtWebEngineCore.framework/Versions/5/QtWebEngineCore
...

[[qanda:topic_unsolved]] QWebEngineView loadProgress not reading from 1 to 100

[[qanda:topic_unsolved]] Font Size problem on 4k monitor

$
0
0

I'm having a problem with font sizes in my Application's web view. As an example, here are 3 captures for our home page. Top one is the WebEngineView via the SimpleBrowser sample app. Second one is Firefox and bottom one is Chrome. You'll note the top one is a little bigger than the other two:

fontsizes.jpg

I have scaling set to the recommended 150%.

My JavaScript guy tells me that it reports devicePixelRatio as 2.0, while Firefox says 1.5. But now we've noticed a caveat that says "The Qt platform plugins round the reported scale factors to the nearest integer." so that's probably not it.

I can set the zoom factor to .8 to get closer to the right size, but then I have to check to see if I'm on a high DPMI monitor or not, and track it if the window moves to an HD monitor (where the size is correct). Ugh. Any other ideas? QA is complaining about it.

Jonathan

[[qanda:topic_unsolved]] App crashing after signing QtWebEngine

$
0
0

Hi,
For the last 4 days I've been trying to publish my app in the apple store (which I've never done before). In it I use qt 5.12.1 with qtwebengine. But I really got stuck with sandboxing webengine because after sandboxing app won't even start. I followed this https://mediaarea.net/blog/2018/02/14/QtWebEngine-MacAppStore initially without recompiling and changing webengine but afterwards doing this as well (Unsuccessfully though 'cause they used qt 5.9). I tried as well suggestions from this thread https://forum.qt.io/topic/102212/qtwebengine-signing-issues/4 and today https://forum.qt.io/topic/49250/solved-qtwebengineprocess-not-working-in-sandboxed-application but had no luck. So I thought maybe you guys could give me some tips on how could I do this. Prior to that I posted same question on stackoverflow there is all relevant information https://stackoverflow.com/questions/58053883/sandboxing-qtwebengine-for-apple-store
(Hope it's ok to attach link on stackoverflow)
I've changed script little bit since then. So here how it looks right now. Plist and entitlement are the same.

echo SIGN PACKAGE
# special case for QtWebEngineCore

find dist/MyApp.app -name Info.plist -exec plutil -replace CFBundleIdentifier -string "com.MyApp.desktop" {} \;

find dist/MyApp.app -name _CodeSignature -exec rm -fr {} \;
find dist/MyApp.app -name "*.dSYM" -exec rm -fr {} \;

#codesign -force -s "3rd Party Mac Developer Application: MyApp (*)" -i "org.qt-project.Qt.QtWebEngineWidgets"

#codesign --force --verify --verbose --sign "3rd Party Mac Developer Application: MyApp (*)" --identifier "" --entitlements app/webengine.entitlements  dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app
codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/Frameworks/QtWebEngine.framework/

codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.QtWebEngineProcess" --entitlements app/MyApp.entitlements  dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app

codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "org.qt-project.Qt.QtWebEngineCore" dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/

for f in $(find dist/MyApp.app/Contents/Frameworks -name '*.framework' -type d)
do
    if [ $f == "dist/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework" ] || [ $f == "dist/MyApp.app/Contents/Frameworks/QtWebEngine.framework" ]; then
    continue
    else
        codesign --force -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" $f
    fi
done

for f in $(find dist/MyApp.app/Contents -name '*.dylib' -type f)
do
codesign --force --verbose -s "3rd Party Mac Developer Application: MyApp (*)" $f
done

codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/crashpad_handler
codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/MyApp
codesign --entitlements app/MyApp.entitlements -s "3rd Party Mac Developer Application: MyApp (*)" -i "com.MyApp.desktop" dist/MyApp.app/Contents/MacOS/MyAppUpdater

codesign --force  --verbose -s "3rd Party Mac Developer Application: MyApp (*)" --entitlements app/MyApp.entitlements dist/MyApp.app

Any suggestions are appreciated because I've already wasted too much time on this and i miss normal coding.

[[qanda:topic_unsolved]] How to use getElementsByClassName with WebEngine runJavascript

$
0
0

Hello,
I'm having a problem modifying the content of HTML document using getElementByClassName or getElementById. My code is not generating error except when there is an error in the code, but it's not working either. Here is the relevant part of my code that is not working:

WebEngineView {
       id: webviewer
       anchors.fill: parent
       url: "https://developer.mozilla.org/en-US/"
       opacity: 1
       visible: true
}


Connections {
   target: webviewer
       onLoadingChanged: {
   	if (WebEngineLoadRequest.LoadSucceededStatus)
   		webviewer.runJavaScript("var Elem = document.getElementsByClassName('highlight-span'); Elem.innerHTML = 'Hello!'";)
}

But when I target a specific HTML element with 1 line of code, it works.

webviewer.runJavascript("document.body.innerHTML = 'Hello!' ")

Is it that runJavascript doesn't understand 2 lines of code? Or getElementsByClassName?
Please what am I doing wrong here?

[[qanda:topic_unsolved]] Disabling zoom in QWebEngine under Qt 5.9.4

$
0
0

We are running a fullscreen QWebEngine app compiled in Qt 5.9.4 for aarch64 platform with wayland+weston. Some of the devices running the app are touchscreens, which allow to interact with displayed pages (mostly custom made html templates). On the touchscreens, it's possible to zoom the page by using the pinch gesture, we would like to disable any zooming at all because all of the displayed content is made to fit fullscreen perfectly.

I have tried many different ways without luck, the only way that works is using runJavaScript to overwrite the meta viewport tag, but I'm not really a fan of this solution as it may interfere with pages actually using some custom viewport settings.

I have tried using setZoomFactor (which didn't work at all), adding --disable-pinch to the startup command which also didn't work, I also wanted to catch the pinch gesture event by installing an event filter on the QWebPage->focusProxy(), but it only returns basic touch events (TouchBegin,TouchEnd,TouchUpdate etc) and I don't know how to determine if it's a zooming event or not.

We cannot change the Qt version. Is it possible in any other way than running the javascript?

[[qanda:topic_unsolved]] QtWebEngine uses up all memory and will not give it back!

$
0
0

Qt 5.12.2. Python/PyQt (though that does not help, it should not be the issue). Tested under Linux, known from user to happen under Windows too. I am in trouble, and I need help from someone who knows their QtWebEngine!

Briefly: I have to create and delete QtWebEngines (for non-interactive use, read below) a large number of times from a loop which cannot call the main event loop. Every instance holds onto its memory allocation --- which is "large" --- until code finally returns to main event loop. I cannot find any way of getting Qt to release the memory being use by QtWebEngine as it proceeds, only when return to main event loop. Result is whole machine runs out of memory + swap space, until it dies/freezes machine requiring reboot!

  • In large body of code, QWebEngineView is employed in a QDialog.

  • Sometimes that dialog is used interactively by user.

  • But it is also used *non-*interactively in order to use its ability to print from HTML to PDF file.

  • Code will do a non-interactive "batch run" of hundreds/thousands of pieces of HTML, exporting to PDF file(s).

  • During this large amounts of memory will be gobbled. So much so that machine can even run out of all memory and die!

  • Only a return to top-level, main Qt event loop allows that memory to be recouped. I need something better than that!

I paste below about as minimal an example of code I am using in a test to prove behaviour.

import sys

from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView


class MyDialog(QtWidgets.QDialog):
    def __init__(self, parent=None):
        super(MyDialog, self).__init__(parent)

        self.wev = QWebEngineView(self)

        self.renderLoop = QtCore.QEventLoop(self)
        self.rendered = False
        self.wev.loadFinished.connect(self.synchronousWebViewLoaded)

        # set some HTML
        html = "<html><body>Hello World</body></html>"
        self.wev.setHtml(html)

        # wait for the HTML to finish rendering asynchronously
        # see synchronousWebViewLoaded() below
        if not self.rendered:
            self.renderLoop.exec()

        # here I would do the printing in real code
        # but it's not necessary to include this to show the memory problem

    def synchronousWebViewLoaded(self, ok: bool):
        self.rendered = True
        # cause the self.renderLoop.exec() in synchronousRenderHtml() above to exit now
        self.renderLoop.quit()


class MyMainWindow(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super(MyMainWindow, self).__init__(parent)

        self.btn = QtWidgets.QPushButton("Do Test", self)
        self.btn.clicked.connect(self.doTest)

    def doTest(self):
        print("Started\n")
        # create & delete 500 non-interactive dialog instances
        for i in range(500):
            # create the dialog, it loads the HTML and waits till it has finished rendering
            dlg = MyDialog(self)
            # try desperately to get to delete the dialog/webengine to reclaim memory...
            dlg.deleteLater()
            # next lines do not help from Python
            # del dlg
            # dlg = None
        QtWidgets.QMessageBox.information(self, "Dismiss to return to main event loop", "At this point memory is still in use :(")


if __name__ == '__main__':
    # -*- coding: utf-8 -*-

    app = QtWidgets.QApplication(sys.argv)

    mainWin = MyMainWindow()
    mainWin.show()

    sys.exit(app.exec())

I have tried various flavours of processEvents() in the loop after deleteLater() but none releases the memory in use. Only, only when the code returns to the top-level, main Qt event loop does it get released. Which is too late.

To monitor what is going on, under Linux I used

watch -n 1 free mem
watch -n 1 ps -C QtWebEngineProc
top -o %MEM

There are two areas of memory hogging:

  • The process itself uses up considerable memory per QtWebEngine
  • It will run 26 (yes, precisely 26) QtWebEngineProc processes to service the requests, each also taking memory.

Both of these disappear as & when return to Qt top-level event loop, so we know the memory can & should be released. I do not know if this behaviour is QtWebEngine specific.

Anyone kind enough to answer will need to be specific about what to put where to resolve or try out, as I say I have tried a lot of fiddling! Unfortunately, advising to do the whole thing "a different way" (e.g. "do not use QtWebEngineView", "rewrite code so it does not have to do hundreds at a time", etc.) is really not what I am looking for, I need to understand why I can't get it to release its memory as it is now?


[[qanda:topic_unsolved]] Qt runJavaScript multiple parameters

$
0
0

@a_d_m
QWebEnginePage::runJavaScript() executes a JS script, passed to it as a text string. What "many parameters" do you mean?

[[qanda:topic_unsolved]] QWebEngineView issue

$
0
0

Trying to get work properly QWebEngineView widget.
Need to display webpage in kinda embedded browser in my app.

From the beginning everything works fine.
I test view with google.com url.
Widget shows page, I can input, click on buttons for search, etc.
But after some time widget seems to crash.
It shows empty window instead of web page.

I've got such log output:

[9428:10292:1007/160758.387:ERROR:sync_point_manager.cc(249)] Client waiting on non-existent sync token The thread 0x13f0 has exited with code 0 (0x0).

What can I do to fix this?

I use Qt 5.13.1 version and Visual Studio 2019.

Here is the source code:

webView = new QWebEngineView(this);
webView->setGeometry(QRect(QPoint(0, 200), QSize(this->width(), this->height() - 200)));
webView->load(QUrl("http://google.com/"));
webView->setFocus();
webView->show();

[[qanda:topic_unsolved]] Netflix Support on QtWebEngine

$
0
0

I am trying to run Netflix on a simple browser application.

Below is my Configuration summary of Rpi 3B+


Configure summary:
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... yes
Printing and PDF ....................... no
Proprietary Codecs ..................... yes
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... yes
Geolocation ............................ yes
WebChannel support ..................... yes
Use v8 snapshot ........................ yes
Kerberos Authentication ................ no
Building v8 snapshot supported ......... yes
Use ALSA ............................... yes
Use PulseAudio ......................... no
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . yes
opus ................................. yes
ffmpeg ............................... yes
libvpx ............................... yes
snappy ............................... yes
glib ................................. yes
zlib ................................. yes
minizip .............................. no
libevent ............................. yes
jsoncpp .............................. no
protobuf ............................. no
libxml2 and libxslt .................. no
lcms2 ................................ no
png .................................. yes
JPEG ................................. yes
harfbuzz ............................. yes
freetype ............................. yes
x11 .................................. no
Required system libraries:
fontconfig ........................... yes
dbus ................................. yes
nss .................................. yes
khr .................................. yes
glibc ................................ yes
Required system libraries for qpa-xcb:
libdrm ............................... no
xcomposite ........................... no
xcursor .............................. no
xi ................................... no
xtst ................................. no

Qt is now configured for building. Just run 'make'.


I face the below error

62735c47-8c35-44a6-88f3-dc100e6e9acb-image.png

Does anyone have a solution?

[[qanda:topic_unsolved]] Profile corruption when using QWebEnginePage together with WebEngineView

$
0
0

I have a desktop application at work that apparently uses both QWebEnginePage to generate a license agreement page as well as two WebEngineView qml components to display some banners in a launcher.

Running the application in debug resulted in an instant crash with an unhandled exception seemingly originating from the Chromium backend. The output log is consistent with: https://bugreports.qt.io/browse/QTBUG-59244.
Running with the debugger attached it seems that its possible to step over the error and execution continues seemingly unaffected.

While investigating, I noticed that if I commented out the qml WebEngineView components, everything worked.
Deleting the "default" profile in %CURRENTUSER%\AppData\Local<AppName>\QWebEngine seems to have fixed it. Unfortunately I can no longer replicate the issue since doing this.

Now, investigating this bug was actually a detour from my original task as such I'm afraid I cannot dig deeper but I am curious to understand more about what might've happened.

The only hypothesis I came up with is that the "default" profile is probably used by both the QWebEnginePage object and the WebEngineView component and this caused some sort of corruption in the profile.

Does this sound likely?
If yes, would creating a profile for the qml components and another profile for the QWebEnginePage object reduce the chances of profile corruption?

These are more theoretical questions really because, like I said, I'm afraid I no longer have the time to dig further into this, especially since so far there haven't been other similar incidents reported.

[[qanda:topic_unsolved]] where QWebEnginePage::linkHovered get its url

$
0
0

Hi,

I have some urls with relative paths that begin with "../" but the url's path that I received from QWebEnginePage::linkHovered begins with the current directory instead of the parent directory.

It's not only the QWebEnginePage::linkHovered that doesn't work for me, if I try to open these urls the QtWebEngine try to use the wrong path.

I'd like to know where is the settings to make the QtWebEngine interpret relative path correctly ?

I don't know if it's related to the fact that I use a custom scheme.

Viewing all 13965 articles
Browse latest View live