[英]QT and window.open
I am developing a browser, it will have support for tabs. 我正在开发一个浏览器,它将支持选项卡。
But I have a difficulty, QWebPage::createWindow
does not differentiate window.open
to <a href="" targert="">
. 但是我有一个困难, QWebPage::createWindow
不能将window.open
<a href="" targert="">
。
eg.: 例如。:
<script>
var params = "menubar=no,location=no,resizable=no";
window.open("http://www.cnn.com/", "_blank", params);
</script>
and 和
<a href="http://www.cnn.com/" target="_blank">
are considered the same by QWebPage::createWindow
被QWebPage::createWindow
认为是相同的
How to differentiate both? 如何区分两者?
When
window.open
I will create a window and when anchors will add a new tab. 当window.open
我将创建一个窗口,当锚点将添加一个新的选项卡。
In QWebPage
, whenever we open a "popup" window using window.open(...)
or window.showModal(...)
she always sends these signals: 在QWebPage
,每当我们使用window.open(...)
或window.showModal(...)
打开“弹出”窗口时,她总是发送以下信号:
toolBarVisibilityChangeRequested(bool))
menuBarVisibilityChangeRequested(bool))
statusBarVisibilityChangeRequested(bool))
Whether or not you've added parameters to your "Popup". 是否已将参数添加到“弹出窗口”。 So using these signs I could differentiate when it is "popup" and when it's a normal "link". 因此,使用这些标志,我可以区分何时是“弹出”和何时是正常的“链接”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.