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;
|
||||
}
|
||||
```
|
@ -21,9 +21,7 @@ The constructor for this class is marked as internal. Third-party code should no
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------ | ----------- |
|
||||
| [\_changedProduct](./puppeteer.puppeteer._changedproduct.md) | <code>protected</code> | boolean | |
|
||||
| [\_isPuppeteerCore](./puppeteer.puppeteer._ispuppeteercore.md) | <code>protected</code> | boolean | |
|
||||
| --------------------------------------------------------------- | --------------------- | ------------------------------------------------------------ | ----------- |
|
||||
| [devices](./puppeteer.puppeteer.devices.md) | <code>readonly</code> | typeof devices | |
|
||||
| [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) | |
|
||||
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
sidebar_label: PuppeteerNode._preferredRevision
|
||||
---
|
||||
|
||||
# PuppeteerNode.\_preferredRevision property
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
class PuppeteerNode {
|
||||
_preferredRevision: string;
|
||||
}
|
||||
```
|
@ -45,8 +45,7 @@ Once you have created a `page` you have access to a large API to interact with t
|
||||
## Properties
|
||||
|
||||
| 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>) |
|
||||
|
||||
## Methods
|
||||
|
@ -54,7 +54,13 @@ export interface ConnectOptions extends BrowserConnectOptions {
|
||||
* @public
|
||||
*/
|
||||
export class Puppeteer {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
protected _isPuppeteerCore: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
protected _changedProduct = false;
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,9 @@ export class PuppeteerNode extends Puppeteer {
|
||||
#projectRoot?: string;
|
||||
#productName?: Product;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_preferredRevision: string;
|
||||
|
||||
/**
|
||||
|
@ -51,58 +51,103 @@ const config = {
|
||||
async sidebarItemsGenerator({defaultSidebarItemsGenerator, ...args}) {
|
||||
const sidebarItems = await defaultSidebarItemsGenerator(args);
|
||||
const apiCategoryItem = sidebarItems.find(value => {
|
||||
return value.type === 'category';
|
||||
return value.type === 'category' && value.label === 'API';
|
||||
});
|
||||
if (
|
||||
apiCategoryItem &&
|
||||
apiCategoryItem.type === 'category' &&
|
||||
apiCategoryItem.label === 'API'
|
||||
) {
|
||||
if (apiCategoryItem) {
|
||||
/** @type {typeof sidebarItems} */
|
||||
const newItems = [];
|
||||
for (const item of apiCategoryItem.items.sort((a, b) => {
|
||||
if ('label' in a && 'label' in b) {
|
||||
return (a.label ?? '') < (b.label ?? '') ? -1 : 1;
|
||||
const categories = new Map();
|
||||
for (const item of apiCategoryItem.items) {
|
||||
const [namespace] = item.label.split('.');
|
||||
if (!categories.has(namespace)) {
|
||||
categories.set(namespace, [item]);
|
||||
} else {
|
||||
categories.get(namespace).push(item);
|
||||
}
|
||||
return -1;
|
||||
})) {
|
||||
if ('id' in 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({
|
||||
}
|
||||
|
||||
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',
|
||||
// @ts-ignore
|
||||
label: namespace,
|
||||
items: [item],
|
||||
items,
|
||||
link: main
|
||||
? {
|
||||
type: 'doc',
|
||||
id: main.id,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
} else {
|
||||
categories.delete(namespace);
|
||||
}
|
||||
for (const namespace of order) {
|
||||
addNamespace(namespace, newItems);
|
||||
}
|
||||
const otherItems = [];
|
||||
newItems.push({
|
||||
type: 'category',
|
||||
// @ts-ignore
|
||||
label: item.label,
|
||||
items: [],
|
||||
link: {type: 'doc', id: item.id},
|
||||
label: 'Other',
|
||||
items: otherItems,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (object) {
|
||||
// @ts-ignore
|
||||
currentItem.items.push(item);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
currentItem.link = {type: 'doc', id: item.id};
|
||||
}
|
||||
}
|
||||
}
|
||||
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.collapsed = false;
|
||||
}
|
||||
const guidesCategory = sidebarItems.find(value => {
|
||||
return value.type === 'category' && value.label === 'Guides';
|
||||
});
|
||||
if (guidesCategory) {
|
||||
guidesCategory.collapsed = false;
|
||||
}
|
||||
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-code-font-size: 95%;
|
||||
--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. */
|
||||
|
Loading…
Reference in New Issue
Block a user