InjectManager
Manages the JavaScript that is injected into the page
Static Method Summary
Static Public Methods | ||
public static |
getCollectInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject Receive param object for JS injected into every frame of the page crawled that sets up out link collection |
|
public static |
getCrawlInjects(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap, JS that scrolls the page automatically and JS that sets up out link collection |
|
public static |
getCrawlInjectsNoScroll(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject Receive param object for JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap and JS that sets up out link collection |
|
public static |
getNoNaughtyJsInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject Receive param object for JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap |
|
public static |
getScollOnLoadInject(onNewDocument: boolean): {"key": *} Receive param object for JS injected into every frame of the page crawled that scrolls the page once the |
|
public static |
getScrollInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject Receive param object for JS injected into every frame of the page crawled that scrolls the page automatically |
|
public static |
Receive the raw function that is used to collect outlinks from the pre-injected script collect for use with Runtime.evaluate |
|
public static |
rawNoNaughty(): function(): void Receive the raw function that helps ensure that the pages JS can not be naughty for use with Runtime.evaluate |
|
public static |
Receive the raw function that is used to collect outlines from each of the pages frames. |
|
public static |
Receive the raw scroll page function for use with Runtime.evaluate |
Static Public Methods
public static getCollectInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject source
Receive param object for JS injected into every frame of the page crawled that sets up out link collection
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
OnNewDocumentInject | OnLoadInject | Object keyed for the params used by the desired CDP method |
public static getCrawlInjects(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject source
JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap, JS that scrolls the page automatically and JS that sets up out link collection
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
OnNewDocumentInject | OnLoadInject | Object keyed for the params used by the desired CDP method |
public static getCrawlInjectsNoScroll(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject source
Receive param object for JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap and JS that sets up out link collection
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
OnNewDocumentInject | OnLoadInject | Object keyed for the params used by the desired CDP method |
public static getNoNaughtyJsInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject source
Receive param object for JS injected into every frame of the page crawled that includes disabling things that can act as an crawler trap
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
OnNewDocumentInject | OnLoadInject | Object keyed for the params used by the desired CDP method |
public static getScollOnLoadInject(onNewDocument: boolean): {"key": *} source
Receive param object for JS injected into every frame of the page crawled that scrolls the page once the load
event has fired
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
{"key": *} |
public static getScrollInject(onNewDocument: boolean): OnNewDocumentInject | OnLoadInject source
Receive param object for JS injected into every frame of the page crawled that scrolls the page automatically
Params:
Name | Type | Attribute | Description |
onNewDocument | boolean |
|
Flag indicating if the inject object is for Page.addScriptToEvaluateOnNewDocument (default) or Page.addScriptToEvaluateOnLoad params |
Return:
OnNewDocumentInject | OnLoadInject | Object keyed for the params used by the desired CDP method |
public static rawCollectInject(): collect source
Receive the raw function that is used to collect outlinks from the pre-injected script collect for use with Runtime.evaluate
public static rawNoNaughty(): function(): void source
Receive the raw function that helps ensure that the pages JS can not be naughty for use with Runtime.evaluate
public static rawOutLinks(): outLinks source
Receive the raw function that is used to collect outlines from each of the pages frames. Used by PuppeteerCrawler
public static rawScoll(): scrollPage source
Receive the raw scroll page function for use with Runtime.evaluate