Open layliu opened 3 years ago
Looking a bit into this, seems that new pages made public have a new attribute requireInterstitial
in their state.
This will then go and render a message that you might see like
Continue to external site by following the link below
Old published page publicPageData
:
{
betaEnabled: false
canJoinSpace: false
canRequestAccess: false
publicAccessRole: "reader"
requireLogin: false
spaceDomain: "redacted"
spaceId: "redacted"
spaceName: "redacted"
userHasExplicitAccess: false
}
New published page publicPageData
:
{
betaEnabled: false
canJoinSpace: false
canRequestAccess: false
icon: "https://lh3.googleusercontent.com/a-/redacted"
publicAccessRole: "reader"
requireInterstitial: "https://random.notion.site/My-page-randomPageId"
requireLogin: false
spaceDomain: "redacted"
spaceId: "redacted"
spaceName: "redacted"
userHasExplicitAccess: false
}
publicPageData
seems to be the server side props that notion server pass to the frontend. Not sure if that might be the case of some similar case I experience creating a new page with the new "domain updates".
A hacky way is to intercept the "/api/v3/getPublicPageData" request from the edge worker and change the retrieved payload by removing the requireInterstitial
attribute.
I just tried creating a page today and get the error you describe here with the page just showing "Continue to external site by following the link below".
Is there is a manual edit that can be made to the fruitionsite script?
A hacky way is to intercept the "/api/v3/getPublicPageData" request from the edge worker and change the retrieved payload by removing the requireInterstitial attribute.
Solution:
Add the following code before else if ((url.pathname.startsWith('/api'))) {
else if ((url.pathname.startsWith('/api/v3/getPublicPageData'))) {
response = await fetch(url.toString(), {
body: request.body,
headers: {
'content-type': 'application/json;charset=UTF-8',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'
},
method: 'POST',
});
response = new Response(response.body, response);
response.headers.set('Access-Control-Allow-Origin', '*');
response.body.delete('requireInterstitial');
return response;
}
Fruition dosen't work on Iphone 5s .Tried on Safari and Chrome ,on two different mobiles and no content display .Before Notion update, sites was displaying ok .
I try to use the latest codes but it still unsuccess.My codes provide via the https://hkusts.notion.site/Fruition-Problem-b163c070b7c94f1ea6f6ddbf1d8a466a
🙁 yes confirm. not working. pls provide update if there is a chance that is going to work again. trusted some sites to this solution, if no future, than have to go for alternatives. thx a lot.
So what I can do now is to wait?
https://twitter.com/NotionHQ/status/1415370771623333889