mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Try to disable caching in the simple browser's iframes
This commit is contained in:
parent
518097377d
commit
87a3effc79
|
@ -194,9 +194,19 @@ events_1.onceDocumentLoaded(() => {
|
||||||
iframe.src = input.value;
|
iframe.src = input.value;
|
||||||
});
|
});
|
||||||
navigateTo(settings.url);
|
navigateTo(settings.url);
|
||||||
|
input.value = settings.url;
|
||||||
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
|
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
|
||||||
function navigateTo(url) {
|
function navigateTo(rawUrl) {
|
||||||
iframe.src = url;
|
try {
|
||||||
|
const url = new URL(rawUrl);
|
||||||
|
// Try to bust the cache for the iframe
|
||||||
|
// There does not appear to be any way to reliably do this except modifying the url
|
||||||
|
url.searchParams.append('vscodeBrowserReqId', Date.now().toString());
|
||||||
|
iframe.src = url.toString();
|
||||||
|
}
|
||||||
|
catch (_a) {
|
||||||
|
iframe.src = rawUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
function toggleFocusLockIndicatorEnabled(enabled) {
|
function toggleFocusLockIndicatorEnabled(enabled) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -84,10 +84,22 @@ onceDocumentLoaded(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
navigateTo(settings.url);
|
navigateTo(settings.url);
|
||||||
|
input.value = settings.url;
|
||||||
|
|
||||||
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
|
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
|
||||||
|
|
||||||
function navigateTo(url: string): void {
|
function navigateTo(rawUrl: string): void {
|
||||||
iframe.src = url;
|
try {
|
||||||
|
const url = new URL(rawUrl);
|
||||||
|
|
||||||
|
// Try to bust the cache for the iframe
|
||||||
|
// There does not appear to be any way to reliably do this except modifying the url
|
||||||
|
url.searchParams.append('vscodeBrowserReqId', Date.now().toString());
|
||||||
|
|
||||||
|
iframe.src = url.toString();
|
||||||
|
} catch {
|
||||||
|
iframe.src = rawUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ export class SimpleBrowserView extends Disposable {
|
||||||
class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
|
class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<input class="url-input" type="text" value=${url}>
|
<input class="url-input" type="text">
|
||||||
|
|
||||||
<nav class="controls">
|
<nav class="controls">
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue