Log to puppeteer from content script
This commit is contained in:
parent
3887b1e296
commit
1932bca139
|
@ -22,6 +22,16 @@
|
||||||
* @return {Promise<Date>}
|
* @return {Promise<Date>}
|
||||||
*/
|
*/
|
||||||
window.__chronoParseDate = function (text, ref, option) {}
|
window.__chronoParseDate = function (text, ref, option) {}
|
||||||
|
/**
|
||||||
|
* @param {...string} text - The objects to log.
|
||||||
|
* @return {Promise<void>}
|
||||||
|
*/
|
||||||
|
window.__mautrixLog = function (...text) {}
|
||||||
|
/**
|
||||||
|
* @param {...string} text - The objects to log.
|
||||||
|
* @return {Promise<void>}
|
||||||
|
*/
|
||||||
|
window.__mautrixError = function (...text) {}
|
||||||
/**
|
/**
|
||||||
* @param {ChatListInfo[]} changes - The chats that changed.
|
* @param {ChatListInfo[]} changes - The chats that changed.
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
|
|
|
@ -126,6 +126,8 @@ export default class MessagesPuppeteer {
|
||||||
await this._preparePage(true)
|
await this._preparePage(true)
|
||||||
|
|
||||||
this.log("Exposing functions")
|
this.log("Exposing functions")
|
||||||
|
await this.page.exposeFunction("__mautrixLog", this.log.bind(this))
|
||||||
|
await this.page.exposeFunction("__mautrixError", this.error.bind(this))
|
||||||
await this.page.exposeFunction("__mautrixReceiveQR", this._receiveQRChange.bind(this))
|
await this.page.exposeFunction("__mautrixReceiveQR", this._receiveQRChange.bind(this))
|
||||||
await this.page.exposeFunction("__mautrixSendEmailCredentials", this._sendEmailCredentials.bind(this))
|
await this.page.exposeFunction("__mautrixSendEmailCredentials", this._sendEmailCredentials.bind(this))
|
||||||
await this.page.exposeFunction("__mautrixReceivePIN", this._receivePIN.bind(this))
|
await this.page.exposeFunction("__mautrixReceivePIN", this._receivePIN.bind(this))
|
||||||
|
|
Loading…
Reference in New Issue