Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Support Puppeteer v5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru authored and nesk committed Nov 30, 2020
1 parent b14d511 commit 36c564a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"license": "MIT",
"repository": "github:nesk/puphpeteer",
"engines": {
"node": ">=8.0.0"
"node": ">=9.0.0"
},
"dependencies": {
"@nesk/rialto": "^1.2.1",
"puppeteer": "~1.18.0"
"puppeteer": "~5.4.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Nesk\Rialto\Data\BasicResource;

class Response extends BasicResource
class HTTPRequest extends BasicResource
{
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Nesk\Rialto\Data\BasicResource;

class Worker extends BasicResource
class HTTPResponse extends BasicResource
{
//
}
2 changes: 1 addition & 1 deletion src/Resources/Request.php → src/Resources/WebWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Nesk\Rialto\Data\BasicResource;

class Request extends BasicResource
class WebWorker extends BasicResource
{
//
}
14 changes: 7 additions & 7 deletions tests/ResourceInstantiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public function __construct(array $browserOptions, string $url) {
'Frame' => function ($puppeteer) {
return $this->Page($puppeteer)->mainFrame();
},
'HTTPRequest' => function ($puppeteer) {
return $this->HTTPResponse($puppeteer)->request();
},
'HTTPResponse' => function ($puppeteer) {
return $this->Page($puppeteer)->goto($this->url);
},
'JSHandle' => function ($puppeteer) {
return $this->Page($puppeteer)->evaluateHandle(JsFunction::createWithBody('window'));
},
Expand All @@ -58,12 +64,6 @@ public function __construct(array $browserOptions, string $url) {
'Page' => function ($puppeteer) {
return $this->Browser($puppeteer)->newPage();
},
'Request' => function ($puppeteer) {
return $this->Response($puppeteer)->request();
},
'Response' => function ($puppeteer) {
return $this->Page($puppeteer)->goto($this->url);
},
'SecurityDetails' => function ($puppeteer) {
return new RiskyResource(function () use ($puppeteer) {
return $this->Page($puppeteer)->goto('https://example.com')->securityDetails();
Expand All @@ -81,7 +81,7 @@ public function __construct(array $browserOptions, string $url) {
'Tracing' => function ($puppeteer) {
return $this->Page($puppeteer)->tracing;
},
'Worker' => function ($puppeteer) {
'WebWorker' => function ($puppeteer) {
$page = $this->Page($puppeteer);
$page->goto($this->url, ['waitUntil' => 'networkidle0']);
return $page->workers()[0];
Expand Down

0 comments on commit 36c564a

Please sign in to comment.