feat: recognize webviews as regular pages (#5905)

This commit is contained in:
musou1500 2020-05-29 17:46:44 +09:00 committed by GitHub
parent 8e8a9df3dd
commit a2ba6f0abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,8 @@ export class Target {
async page(): Promise<Page | null> {
if (
(this._targetInfo.type === 'page' ||
this._targetInfo.type === 'background_page') &&
this._targetInfo.type === 'background_page' ||
this._targetInfo.type === 'webview') &&
!this._pagePromise
) {
this._pagePromise = this._sessionFactory().then((client) =>
@ -128,14 +129,16 @@ export class Target {
| 'service_worker'
| 'shared_worker'
| 'other'
| 'browser' {
| 'browser'
| 'webview' {
const type = this._targetInfo.type;
if (
type === 'page' ||
type === 'background_page' ||
type === 'service_worker' ||
type === 'shared_worker' ||
type === 'browser'
type === 'browser' ||
type === 'webview'
)
return type;
return 'other';