api/page: add reload
This commit is contained in:
parent
74ebd51ad1
commit
925cd87b83
13
gluon.d.ts
vendored
13
gluon.d.ts
vendored
@ -70,7 +70,18 @@ type PageApi = {
|
|||||||
title(
|
title(
|
||||||
/** Set the page title to a new title. */
|
/** Set the page title to a new title. */
|
||||||
newTitle: string
|
newTitle: string
|
||||||
): Promise<string>
|
): Promise<string>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload the page.
|
||||||
|
*/
|
||||||
|
reload(
|
||||||
|
/**
|
||||||
|
* Optionally ignore the cache for the reload.
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreCache?: Boolean
|
||||||
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
type IPCStoreApi = {
|
type IPCStoreApi = {
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
## v0.12.0
|
## v0.12.0
|
||||||
- [X] Add new freezing API to Idle API
|
- [X] Add new freezing API to Idle API
|
||||||
- [X] Minor stability/edge-case improvements
|
- [X] Minor stability/edge-case improvements
|
||||||
- [X] Some API tweaks
|
|
||||||
- [X] Local improvements
|
- [X] Local improvements
|
||||||
- [X] Experimental V8 Cache API
|
- [X] Experimental V8 Cache API
|
||||||
- [X] Massive startup time speedup (~1s -> ~0.4s)
|
- [X] Massive startup time speedup (~1s -> ~0.4s)
|
||||||
|
- [X] Tweak and add to Page API
|
||||||
- [ ] Initial system tray API (Windows only for WIP)
|
- [ ] Initial system tray API (Windows only for WIP)
|
||||||
- [ ] Frameless windows (Windows only for WIP)
|
- [ ] Frameless windows (Windows only for WIP)
|
||||||
- [ ] Hide window completely (Windows only for WIP)
|
- [ ] Hide window completely (Windows only for WIP)
|
||||||
|
@ -103,6 +103,12 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN
|
|||||||
title: val => {
|
title: val => {
|
||||||
if (!val) return evalInWindow('document.title');
|
if (!val) return evalInWindow('document.title');
|
||||||
return evalInWindow(`document.title = \`${val}\``);
|
return evalInWindow(`document.title = \`${val}\``);
|
||||||
|
},
|
||||||
|
|
||||||
|
reload: async (ignoreCache = false) => {
|
||||||
|
await Window.cdp.send('Page.reload', {
|
||||||
|
ignoreCache
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user