Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to bypass CSP? #144

Open
yungd1plomat opened this issue Dec 18, 2024 · 1 comment
Open

Is there any way to bypass CSP? #144

yungd1plomat opened this issue Dec 18, 2024 · 1 comment

Comments

@yungd1plomat
Copy link

yungd1plomat commented Dec 18, 2024

Related to microsoft/playwright#21780.
Is there any way to bypass cross-origin objects?
Because this code

document.querySelector('iframe[title="Основное содержание испытания hCaptcha"]').contentWindow.document 

returns Uncaught DOMException: Permission denied to access property "document" on cross-origin object.
Same in playwright:

captcha = await page.wait_for_selector('iframe[title="Основное содержание испытания hCaptcha"]')
frame = await captcha.content_frame()

Exception:

ElementHandle.content_frame: Protocol error (Page.describeNode): error in channel "content::9/13/2": exception while running method "describeNode" in namespace "page": Permission denied to access property "docShell" on cross-origin object _describeNode@chrome://juggler/content/content/PageAgent.js:417:62
_onMessageInternal@chrome://juggler/content/SimpleChannel.js:237:37
_onMessage@chrome://juggler/content/SimpleChannel.js:194:12
bindToActor/actor.receiveMessage@chrome://juggler/content/SimpleChannel.js:39:44
playwright._impl._errors.Error: Protocol error (Page.describeNode): error in channel "content::9/13/2": exception while running method "describeNode" in namespace "page": Permission denied to access property "docShell" on cross-origin object _describeNode@chrome://juggler/content/content/PageAgent.js:417:62
_onMessageInternal@chrome://juggler/content/SimpleChannel.js:237:37
_onMessage@chrome://juggler/content/SimpleChannel.js:194:12
bindToActor/actor.receiveMessage@chrome://juggler/content/SimpleChannel.js:39:44

Methods like bounding_box() work and return everything correctly, but page.mouse.click(x, y) on iframe coordinates also doesn't work

@yungd1plomat
Copy link
Author

seems to be only a playwright problem, puppeteer and selenium knows how to work with OOPIF, is there any way to connect them instead of playwright?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant