简体   繁体   中英

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=""> .

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

How to differentiate both?

When window.open I will create a window and when anchors will add a new tab.

In QWebPage , whenever we open a "popup" window using window.open(...) or window.showModal(...) she always sends these signals:

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM