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

how to set "download_restrictions" by godet? #58

Closed
terry2010 opened this issue Jun 13, 2023 · 1 comment
Closed

how to set "download_restrictions" by godet? #58

terry2010 opened this issue Jun 13, 2023 · 1 comment

Comments

@terry2010
Copy link
Contributor

terry2010 commented Jun 13, 2023

I want to block all downloads , but can not find a way to set it.

selenium could set download_restrictions :3 to settle this .

Remote.SetDownloadBehavior(godet.DenyDownload,"/A:")
Tab, err = Remote.NewTab("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BF49017DD-2E64-6292-C8FB-E1121560FAAA%7D%26lang%3Dzh-CN%26browser%3D3%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26brand%3DYTUH%26installdataindex%3Dempty/update2/installers/ChromeSetup.exe")

not work

there must a way by godet , how to set it , thank you

@raff
Copy link
Owner

raff commented Jun 13, 2023

This seems to work for me:

` remote.SetDownloadBehavior(godet.DenyDownload, "")

    // try download
    remote.Navigate("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BF49017DD-2E64-6292-C8FB-E1121560FAAA%7D%26lang%3Dzh-CN%26browser%3D3%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26brand%3DYTUH%26installdataindex%3Dempty/update2/installers/ChromeSetup.exe")

`
If I comment out the call to SetDownloadBehaviour the file gets downloaded.

@raff raff closed this as completed Jun 19, 2023
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

2 participants