Skip to content

Commit 7abb08c

Browse files
committed
feat: ignore cache on reload
1 parent e5653b0 commit 7abb08c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/tool-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149

150150
**Parameters:**
151151

152+
- **ignoreCache** (boolean) _(optional)_: Whether to ignore cache on reload.
152153
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
153154
- **type** (enum: "url", "back", "forward", "reload") _(optional)_: Navigate the page by URL, back or forward in history, or reload.
154155
- **url** (string) _(optional)_: Target URL (only type=url)

src/tools/pages.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export const navigatePage = defineTool({
112112
'Navigate the page by URL, back or forward in history, or reload.',
113113
),
114114
url: zod.string().optional().describe('Target URL (only type=url)'),
115+
ignoreCache: zod
116+
.boolean()
117+
.optional()
118+
.describe('Whether to ignore cache on reload.'),
115119
...timeoutSchema,
116120
},
117121
handler: async (request, response, context) => {
@@ -171,7 +175,10 @@ export const navigatePage = defineTool({
171175
break;
172176
case 'reload':
173177
try {
174-
await page.reload(options);
178+
await page.reload({
179+
...options,
180+
ignoreCache: request.params.ignoreCache,
181+
});
175182
response.appendResponseLine(`Successfully reloaded the page.`);
176183
} catch (error) {
177184
response.appendResponseLine(

0 commit comments

Comments
 (0)