-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor mixins and improve their typing (#392)
- Loading branch information
1 parent
a0d44b9
commit d1fda80
Showing
14 changed files
with
603 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
/** | ||
* | ||
* @this {import('../remote-debugger').RemoteDebugger} | ||
* @returns {Promise<void>} | ||
*/ | ||
export async function getCookies () { | ||
this.log.debug('Getting cookies'); | ||
return await this.requireRpcClient().send('Page.getCookies', { | ||
appIdKey: this.appIdKey, | ||
pageIdKey: this.pageIdKey | ||
}); | ||
} | ||
|
||
/** | ||
* | ||
* @this {import('../remote-debugger').RemoteDebugger} | ||
* @param {any} cookie | ||
* @returns {Promise<any>} | ||
*/ | ||
export async function setCookie (cookie) { | ||
this.log.debug('Setting cookie'); | ||
return await this.requireRpcClient().send('Page.setCookie', { | ||
appIdKey: this.appIdKey, | ||
pageIdKey: this.pageIdKey, | ||
cookie | ||
}); | ||
} | ||
|
||
/** | ||
* | ||
* @this {import('../remote-debugger').RemoteDebugger} | ||
* @param {string} cookieName | ||
* @param {string} url | ||
* @returns {Promise<any>} | ||
*/ | ||
export async function deleteCookie (cookieName, url) { | ||
this.log.debug(`Deleting cookie '${cookieName}' on '${url}'`); | ||
return await this.requireRpcClient().send('Page.deleteCookie', { | ||
appIdKey: this.appIdKey, | ||
pageIdKey: this.pageIdKey, | ||
cookieName, | ||
url, | ||
}); | ||
} |
Oops, something went wrong.