Skip to content

Commit bfd5cb8

Browse files
committed
chore: send full url to phoenix for get content
1 parent 79e32f9 commit bfd5cb8

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

docs/pageLoader.html

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,9 @@
4747
e.preventDefault();
4848
}
4949
}, false);
50-
// https://developer.mozilla.org/en-US/docs/Web/Privacy/Storage_Access_Policy/Errors/CookiePartitionedForeign
51-
// iframes are sandboxed by default and if we popout the live preview, those previews wont be
52-
// reachable from this sandboxed iframe server. So we have to request access.
53-
// https://developer.mozilla.org/en-US/docs/Web/API/Document/requestStorageAccess
54-
document.requestStorageAccess && document.requestStorageAccess().then(
55-
() => {
56-
console.log("access granted");
57-
},
58-
() => {
59-
console.log("access denied");
60-
}
61-
);
50+
// do not document.requestStorageAccess as we need an isolated sandboxed
51+
// idb/storage/domain partitin even within live
52+
// preview in same domain
6253
</script>
6354
<script type="module">
6455
const clientID = "" + Math.round( Math.random()*1000000000);

docs/virtual-server-main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ workbox.routing.registerRoute(
105105
path = `/${pathSplit.join("/")}`;
106106
}
107107

108-
return Serve.serve(path, phoenixInstanceID);
108+
return Serve.serve(path, phoenixInstanceID, url.href);
109109
},
110110
'GET'
111111
);

docs/virtualServer/webserver.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if(!self.Serve){
3131
return Math.round( Math.random()*1000000000000);
3232
}
3333

34-
const serve = async function (path, phoenixInstanceID) {
34+
const serve = async function (path, phoenixInstanceID, url) {
3535
path = Path.normalize(path);
3636
return new Promise(async (resolve, reject) => { // eslint-disable-line
3737
function buildResponse(responseData) {
@@ -42,6 +42,7 @@ if(!self.Serve){
4242
_serverBroadcastChannel.postMessage({
4343
type: "GET_CONTENT",
4444
path,
45+
url,
4546
requestID,
4647
phoenixInstanceID
4748
});

0 commit comments

Comments
 (0)