mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
parent
1ecb6e3f19
commit
27ccd0ae5e
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
sidebar_label: Puppeteer._changedProduct
|
|
||||||
---
|
|
||||||
|
|
||||||
# Puppeteer.\_changedProduct property
|
|
||||||
|
|
||||||
**Signature:**
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
class Puppeteer {
|
|
||||||
protected _changedProduct: boolean;
|
|
||||||
}
|
|
||||||
```
|
|
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
sidebar_label: Puppeteer._isPuppeteerCore
|
|
||||||
---
|
|
||||||
|
|
||||||
# Puppeteer.\_isPuppeteerCore property
|
|
||||||
|
|
||||||
**Signature:**
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
class Puppeteer {
|
|
||||||
protected _isPuppeteerCore: boolean;
|
|
||||||
}
|
|
||||||
```
|
|
@ -20,13 +20,11 @@ The constructor for this class is marked as internal. Third-party code should no
|
|||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| --------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------ | ----------- |
|
| --------------------------------------------------------------- | --------------------- | ------------------------------------------------------------ | ----------- |
|
||||||
| [\_changedProduct](./puppeteer.puppeteer._changedproduct.md) | <code>protected</code> | boolean | |
|
| [devices](./puppeteer.puppeteer.devices.md) | <code>readonly</code> | typeof devices | |
|
||||||
| [\_isPuppeteerCore](./puppeteer.puppeteer._ispuppeteercore.md) | <code>protected</code> | boolean | |
|
| [errors](./puppeteer.puppeteer.errors.md) | <code>readonly</code> | typeof [errors](./puppeteer.errors.md) | |
|
||||||
| [devices](./puppeteer.puppeteer.devices.md) | <code>readonly</code> | typeof devices | |
|
| [networkConditions](./puppeteer.puppeteer.networkconditions.md) | <code>readonly</code> | typeof [networkConditions](./puppeteer.networkconditions.md) | |
|
||||||
| [errors](./puppeteer.puppeteer.errors.md) | <code>readonly</code> | typeof [errors](./puppeteer.errors.md) | |
|
|
||||||
| [networkConditions](./puppeteer.puppeteer.networkconditions.md) | <code>readonly</code> | typeof [networkConditions](./puppeteer.networkconditions.md) | |
|
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
sidebar_label: PuppeteerNode._preferredRevision
|
|
||||||
---
|
|
||||||
|
|
||||||
# PuppeteerNode.\_preferredRevision property
|
|
||||||
|
|
||||||
**Signature:**
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
class PuppeteerNode {
|
|
||||||
_preferredRevision: string;
|
|
||||||
}
|
|
||||||
```
|
|
@ -44,10 +44,9 @@ Once you have created a `page` you have access to a large API to interact with t
|
|||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Property | Modifiers | Type | Description |
|
| Property | Modifiers | Type | Description |
|
||||||
| ---------------------------------------------------------------------- | --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------- | --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
| [\_preferredRevision](./puppeteer.puppeteernode._preferredrevision.md) | | string | |
|
| [product](./puppeteer.puppeteernode.product.md) | <code>readonly</code> | string | The name of the browser that is under automation (<code>"chrome"</code> or <code>"firefox"</code>) |
|
||||||
| [product](./puppeteer.puppeteernode.product.md) | <code>readonly</code> | string | The name of the browser that is under automation (<code>"chrome"</code> or <code>"firefox"</code>) |
|
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
@ -54,7 +54,13 @@ export interface ConnectOptions extends BrowserConnectOptions {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export class Puppeteer {
|
export class Puppeteer {
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
protected _isPuppeteerCore: boolean;
|
protected _isPuppeteerCore: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
protected _changedProduct = false;
|
protected _changedProduct = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,6 +78,9 @@ export class PuppeteerNode extends Puppeteer {
|
|||||||
#projectRoot?: string;
|
#projectRoot?: string;
|
||||||
#productName?: Product;
|
#productName?: Product;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
_preferredRevision: string;
|
_preferredRevision: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,58 +51,103 @@ const config = {
|
|||||||
async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) {
|
async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) {
|
||||||
const sidebarItems = await defaultSidebarItemsGenerator(args);
|
const sidebarItems = await defaultSidebarItemsGenerator(args);
|
||||||
const apiCategoryItem = sidebarItems.find(value => {
|
const apiCategoryItem = sidebarItems.find(value => {
|
||||||
return value.type === 'category';
|
return value.type === 'category' && value.label === 'API';
|
||||||
});
|
});
|
||||||
if (
|
if (apiCategoryItem) {
|
||||||
apiCategoryItem &&
|
|
||||||
apiCategoryItem.type === 'category' &&
|
|
||||||
apiCategoryItem.label === 'API'
|
|
||||||
) {
|
|
||||||
/** @type {typeof sidebarItems} */
|
/** @type {typeof sidebarItems} */
|
||||||
const newItems = [];
|
const newItems = [];
|
||||||
for (const item of apiCategoryItem.items.sort((a, b) => {
|
const categories = new Map();
|
||||||
if ('label' in a && 'label' in b) {
|
for (const item of apiCategoryItem.items) {
|
||||||
return (a.label ?? '') < (b.label ?? '') ? -1 : 1;
|
const [namespace] = item.label.split('.');
|
||||||
}
|
if (!categories.has(namespace)) {
|
||||||
return -1;
|
categories.set(namespace, [item]);
|
||||||
})) {
|
} else {
|
||||||
if ('id' in item) {
|
categories.get(namespace).push(item);
|
||||||
// @ts-ignore
|
|
||||||
const [namespace, object] = item.label.split('.');
|
|
||||||
const currentItem = newItems[newItems.length - 1];
|
|
||||||
if (
|
|
||||||
!currentItem ||
|
|
||||||
!('label' in currentItem) ||
|
|
||||||
currentItem.label !== namespace
|
|
||||||
) {
|
|
||||||
if (object) {
|
|
||||||
newItems.push({
|
|
||||||
type: 'category',
|
|
||||||
// @ts-ignore
|
|
||||||
label: namespace,
|
|
||||||
items: [item],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
newItems.push({
|
|
||||||
type: 'category',
|
|
||||||
// @ts-ignore
|
|
||||||
label: item.label,
|
|
||||||
items: [],
|
|
||||||
link: {type: 'doc', id: item.id},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (object) {
|
|
||||||
// @ts-ignore
|
|
||||||
currentItem.items.push(item);
|
|
||||||
} else {
|
|
||||||
// @ts-ignore
|
|
||||||
currentItem.link = {type: 'doc', id: item.id};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const order = [
|
||||||
|
// PuppeteerNode and Puppeteer go first as the entrypoints into
|
||||||
|
// the Puppeteer API.
|
||||||
|
'PuppeteerNode',
|
||||||
|
'Puppeteer',
|
||||||
|
'BrowserFetcher',
|
||||||
|
'Browser',
|
||||||
|
'BrowserContext',
|
||||||
|
'Page',
|
||||||
|
'WebWorker',
|
||||||
|
'Accessibility',
|
||||||
|
'Keyboard',
|
||||||
|
'Mouse',
|
||||||
|
'Touchscreen',
|
||||||
|
'Tracing',
|
||||||
|
'FileChooser',
|
||||||
|
'Dialog',
|
||||||
|
'ConsoleMessage',
|
||||||
|
'Frame',
|
||||||
|
'JSHandle',
|
||||||
|
'ElementHandle',
|
||||||
|
'HTTPRequest',
|
||||||
|
'HTTPResponse',
|
||||||
|
'SecurityDetails',
|
||||||
|
'Target',
|
||||||
|
'CDPSession',
|
||||||
|
'Coverage',
|
||||||
|
'TimeoutError',
|
||||||
|
'EventEmitter',
|
||||||
|
];
|
||||||
|
|
||||||
|
function addNamespace(namespace, target) {
|
||||||
|
let items = categories.get(namespace);
|
||||||
|
if (!items) {
|
||||||
|
throw new Error(`Namespace ${namespace} not found`);
|
||||||
|
}
|
||||||
|
items.sort((a, b) => {
|
||||||
|
return a.label.localeCompare(b.label);
|
||||||
|
});
|
||||||
|
const main = items.find(item => {
|
||||||
|
return item.label === namespace;
|
||||||
|
});
|
||||||
|
items = items.filter(item => {
|
||||||
|
return item !== main;
|
||||||
|
});
|
||||||
|
target.push({
|
||||||
|
type: 'category',
|
||||||
|
label: namespace,
|
||||||
|
items,
|
||||||
|
link: main
|
||||||
|
? {
|
||||||
|
type: 'doc',
|
||||||
|
id: main.id,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
});
|
||||||
|
categories.delete(namespace);
|
||||||
|
}
|
||||||
|
for (const namespace of order) {
|
||||||
|
addNamespace(namespace, newItems);
|
||||||
|
}
|
||||||
|
const otherItems = [];
|
||||||
|
newItems.push({
|
||||||
|
type: 'category',
|
||||||
|
label: 'Other',
|
||||||
|
items: otherItems,
|
||||||
|
});
|
||||||
|
const remaining = Array.from(categories.keys());
|
||||||
|
remaining.sort((a, b) => {
|
||||||
|
return a.localeCompare(b);
|
||||||
|
});
|
||||||
|
for (const namespace of remaining) {
|
||||||
|
addNamespace(namespace, otherItems);
|
||||||
|
}
|
||||||
apiCategoryItem.items = newItems;
|
apiCategoryItem.items = newItems;
|
||||||
|
apiCategoryItem.collapsed = false;
|
||||||
|
}
|
||||||
|
const guidesCategory = sidebarItems.find(value => {
|
||||||
|
return value.type === 'category' && value.label === 'Guides';
|
||||||
|
});
|
||||||
|
if (guidesCategory) {
|
||||||
|
guidesCategory.collapsed = false;
|
||||||
}
|
}
|
||||||
return sidebarItems;
|
return sidebarItems;
|
||||||
},
|
},
|
||||||
|
2469
website/package-lock.json
generated
2469
website/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,7 @@
|
|||||||
--ifm-color-primary-lightest: #3cad6e;
|
--ifm-color-primary-lightest: #3cad6e;
|
||||||
--ifm-code-font-size: 95%;
|
--ifm-code-font-size: 95%;
|
||||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
||||||
|
--doc-sidebar-width: 400px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||||
|
Loading…
Reference in New Issue
Block a user