Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Dialog vertical positioning changes ?
Fine, but it does not help me to see what could be wrong with sandboxing. I’ve got no local mac setup to test other public themes, but the demo site works fine in Safari. Would you mind posting more details of what happens if sandbox is checked, please?
Offline
Re: Dialog vertical positioning changes ?
etc wrote #338513:
I’ve got no local mac setup to test other public themes
Aside: we have a gratis / donated BrowserStack account if that’s useful.
Offline
Re: Dialog vertical positioning changes ?
gaekwad wrote #338516:
Aside: we have a gratis / donated BrowserStack account if that’s useful.
Ah, might be.
Offline
Re: Dialog vertical positioning changes ?
etc wrote #338513:
Fine, but it does not help me to see what could be wrong with sandboxing. I’ve got no local mac setup to test other public themes, but the demo site works fine in Safari. Would you mind posting more details of what happens if sandbox is checked, please?
I have already explained in this or previous thread the multiple issues. Start by inserting some script in the page – <script src=path/to/prism.js
. The page never displays as scripting isnot allowed in the sandbox and your script to remove the style block (opacity:0
in the source document is not removed. Having (stricter) CSP directives also triggers “failures” –stylesheets, images, …not loaded with the appropriate memo in the console, such as, paraphrasing, “stylesheet.css not allowed by style-src…”.
As I said, Safari appears to have a rather strict understanding of sandbox
.
Maybe I have time and energy over the we to dig it all up, including the console messages. Don’t bet on it though. Monday is more likely.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Dialog vertical positioning changes ?
phiw13 wrote #338520:
Start by inserting some script in the page –
<script src=path/to/prism.js
. The page never displays as scripting isnot allowed in the sandbox and your script to remove the style block (opacity:0
in the source document is not removed.
Isn’t it a path problem? Relative links in preview are resolved in admin URL context, try setting <base />
in your public theme.
Having (stricter) CSP directives also triggers “failures” –stylesheets, images, …not loaded with the appropriate memo in the console, such as, paraphrasing, “stylesheet.css not allowed by style-src…”.
CSP needs to be tweaked, sure, even for unsandboxed preview.
Offline
Re: Dialog vertical positioning changes ?
Screenshot: dev.l-c-n.com/_b/saf18-sandbox-iframe.png
Actual issue: the iframe is/looks blank as this: <style id="HIDEHTML">html { opacity: 0.0 !important;}</style>
has not been removed.
Source of article (oldie): emps.l-c-n.com/notebook/using-svg-files-as-content-images
One script, 2 web fonts, 1 stylesheet – all root relative URL
Console:
[Error] Blocked script execution in ‘about:blank’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set. (x2)
[Error] Blocked script execution in ‘about:blank’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set. (anonymous function) (jquery.js:2:47744)
[Error] Blocked script execution in ‘about:srcdoc’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set. (x3)
[Error] Origin null is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. Status code: 200 (pt_sans-narrow-bold.woff2, line 0)
[Error] Origin null is not allowed by Access-Control-Allow-Origin. Status code: 200
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. Status code: 200 (SourceSerif4Variable-Roman.ttf.woff2, line 0)
[Error] Blocked script execution in ‘about:srcdoc’ because the document’s frame is sandboxed and the ‘allow-scripts’ permission is not set.
–^–
PS
ui-dialog:has(#preview-frame.disabled)::before {
width: clamp(1em, 15%, 4em);
aspect-ratio: 1/1;
}
for your pleasure…
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Dialog vertical positioning changes ?
Thanks, but this is not fair because I have replaced iframe’s sandbox="allow-scripts"
with sandbox=""
on your demand. If you could manually (in Safari console) reset it to allow-scripts
before updating the preview, that would be ace. As for fonts, that’s another problem.
Offline
Offline
Re: Dialog vertical positioning changes ?
etc wrote #338524:
Thanks, but this is not fair because I have replaced iframe’s
sandbox="allow-scripts"
withsandbox=""
on your demand. If you could manually (in Safari console) reset it toallow-scripts
before updating the preview, that would be ace. As for fonts, that’s another problem.
<sigh>
Sandbox attribute is set, checkbox is ticked (default view), see image: dev.l-c-n.com/_b/saf18-sandbox2.png. If scripts are allowed, or if sandbox
is removed, (equivalent to uncheck the checkbox at the bottom) then of course the page renders as expect with scripts, fonts and the whole payload.
To recap what I have been saying endlessly: sandboxed preview displays a blank panel in Safari. With sandbox="allow scripts"
the page is rendered (minus webfonts), depending on CSP directives the stylesheet is blocked as well. With the sandbox attribute removed, all is well.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Dialog vertical positioning changes ?
phiw13 wrote #338526:
With
sandbox="allow scripts"
the page is rendered (minus webfonts), depending on CSP directives the stylesheet is blocked as well. With the sandbox attribute removed, all is well.
That’s what I wanted to know, thanks. The interplay between sandbox and csp seems different in Safari and Firefox. Adding self
to style-src-elem
allows Firefox to load styles even in sandbox.
Offline
Re: Dialog vertical positioning changes ?
BTW, Something I forgot to note, the first two errors mentioned happen when the article write panel is first loaded – and thus before accessing the preview iframe.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Dialog vertical positioning changes ?
Offline