PyQt6 - Problem with --disable-web-security
-
wrote on 23 Dec 2022, 12:08 last edited by
Hi, the flag "--disable-web-security" doesn't seem to work, for PyQt6, inside the QApplication() arguments. I wrote the following code:
sys.argv.append("--disable-web-security") app = QApplication(sys.argv)
The same code works on PyQt5. Can you help me please?
Thank you. -
Hi, the flag "--disable-web-security" doesn't seem to work, for PyQt6, inside the QApplication() arguments. I wrote the following code:
sys.argv.append("--disable-web-security") app = QApplication(sys.argv)
The same code works on PyQt5. Can you help me please?
Thank you.wrote on 26 Dec 2022, 08:17 last edited by StarterKit@Angelo54, implementation of flags and features may differ a lot between releases.
Could you please explain what you want to achieve with help of this option? i.e. why do you need it? -
Hi, the flag "--disable-web-security" doesn't seem to work, for PyQt6, inside the QApplication() arguments. I wrote the following code:
sys.argv.append("--disable-web-security") app = QApplication(sys.argv)
The same code works on PyQt5. Can you help me please?
Thank you.Hi, and welcome!
@Angelo54 said in PyQt6 - Problem with --disable-web-security:
the flag "--disable-web-security" doesn't seem to work, for PyQt6
That flag works for very old versions of Chromium (which is the core of Qt WebEngine). Newer versions of Chromium don't accept it by itself anymore: https://stackoverflow.com/a/55442160/1144539
-
Hi, and welcome!
@Angelo54 said in PyQt6 - Problem with --disable-web-security:
the flag "--disable-web-security" doesn't seem to work, for PyQt6
That flag works for very old versions of Chromium (which is the core of Qt WebEngine). Newer versions of Chromium don't accept it by itself anymore: https://stackoverflow.com/a/55442160/1144539
wrote on 29 Dec 2022, 16:03 last edited byThank you.
Using the flag "--disable-web-security" on PyQt5, I can access to the HTML inside the "iframe" elements, using javascript code like this:var iframe = document.querySelector("#iframe-id"); var doc = iframe.contentWindow.document;
I can't access to the iframe content without that flag.
Do you have any suggestions to achieve the same goal? -
Thank you.
Using the flag "--disable-web-security" on PyQt5, I can access to the HTML inside the "iframe" elements, using javascript code like this:var iframe = document.querySelector("#iframe-id"); var doc = iframe.contentWindow.document;
I can't access to the iframe content without that flag.
Do you have any suggestions to achieve the same goal?@Angelo54 said in PyQt6 - Problem with --disable-web-security:
I can access to the HTML inside the "iframe" elements, using javascript code like this:
var iframe = document.querySelector("#iframe-id"); var doc = iframe.contentWindow.document;
Sounds like your iframe comes from a different origin compared to your "main" page?
I don't think that's allowed anymore in modern browsers, because it is a security flaw . See https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame
1/5