Skip to content

Disable Chrome PDF VIEW and Keyboard API not working #698

@paulb057

Description

@paulb057

I am clicking a link, and it is loading the PDF in Chrome rather than downloading it. In my browser settings (chrome://settings/content/pdfDocuments) i have this turned off; however, with the script it is doing.

I have two questions

  1. How do I disable this so that the download is forced in my createBrowser ?
  2. How do I save the PDF that is loading in the tab? I would prefer to save it via script rather than using the Keyboard API, but I tried that, and it is not working for me.

The below code loads the PDF however the keys do not look to work

	$page2 = $browser->createPage();
	$page2->navigate('http://127.0.0.1:5000/admin/'.$href);
	$page2->setDownloadPath('\downloads');
	sleep(5);
	$page2->keyboard()
		->press('control')
		->type('s')
		->release('Control');
	$page2->keyboard()
		->type('enter');
	$page2->keyboard()
		->press('control') 
		->type('w');

Thanks for any help you can give

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions