diff --git a/gluon.d.ts b/gluon.d.ts index 815446b..1497be7 100644 --- a/gluon.d.ts +++ b/gluon.d.ts @@ -70,7 +70,18 @@ type PageApi = { title( /** Set the page title to a new title. */ newTitle: string - ): Promise + ): Promise, + + /** + * Reload the page. + */ + reload( + /** + * Optionally ignore the cache for the reload. + * @default false + */ + ignoreCache?: Boolean + ) }; type IPCStoreApi = { diff --git a/roadmap.md b/roadmap.md index 58ab709..2f7c883 100644 --- a/roadmap.md +++ b/roadmap.md @@ -18,10 +18,10 @@ ## v0.12.0 - [X] Add new freezing API to Idle API - [X] Minor stability/edge-case improvements -- [X] Some API tweaks - [X] Local improvements - [X] Experimental V8 Cache API - [X] Massive startup time speedup (~1s -> ~0.4s) +- [X] Tweak and add to Page API - [ ] Initial system tray API (Windows only for WIP) - [ ] Frameless windows (Windows only for WIP) - [ ] Hide window completely (Windows only for WIP) diff --git a/src/launcher/inject.js b/src/launcher/inject.js index c2c1bee..9872852 100644 --- a/src/launcher/inject.js +++ b/src/launcher/inject.js @@ -103,6 +103,12 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN title: val => { if (!val) return evalInWindow('document.title'); return evalInWindow(`document.title = \`${val}\``); + }, + + reload: async (ignoreCache = false) => { + await Window.cdp.send('Page.reload', { + ignoreCache + }); } },