Displaying HTML via _canonical_uri blocks CSS (sandbox)

62 views
Skip to first unread message

Mark S.

unread,
Apr 10, 2021, 11:46:38 PM4/10/21
to TiddlyWiki
If you try to display an HTML page inside a _canonical_uri, it won't use the external CSS page because (I think) of the sandbox attribute. Other than hacking the code, or rolling your own iframe, is there some way to get the iframe to display properly?

Use case. I would like to off-load article-size tiddlers to their own HTML pages, allowing them to be viewed inside a _canonical_uri tiddler. Unfortunately, the formatting is broken because the page refuses to use the accompanying spreadsheet. Manually removing the sandbox attribute from the inspector seems to fix this, so I assume that this is happening because of the sandbox attribute.

Jeremy Ruston

unread,
Apr 11, 2021, 5:29:19 AM4/11/21
to tiddl...@googlegroups.com
Hi Mark

As you suggest, rolling your own iframe with something like this macro might be workable in some situations:

\define non-sandboxed-iframe(title)
<iframe src={{{ [<title>get[_canonical_uri]] }}}></iframe>
\end

In terms of improving core support, an obvious solution would be some sort of “_sandbox” field on text/html tiddlers, but that doesn’t quite work because the parsing architecture is based around parsing chunks of text with a MIME type, and not necessarily parsing actual tiddlers.

So, I think the best we can do might be to provide a global hidden setting, which I’ve added for the prerelease here:


Best wishes

Jeremy.


On 11 Apr 2021, at 04:46, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:

If you try to display an HTML page inside a _canonical_uri, it won't use the external CSS page because (I think) of the sandbox attribute. Other than hacking the code, or rolling your own iframe, is there some way to get the iframe to display properly?

Use case. I would like to off-load article-size tiddlers to their own HTML pages, allowing them to be viewed inside a _canonical_uri tiddler. Unfortunately, the formatting is broken because the page refuses to use the accompanying spreadsheet. Manually removing the sandbox attribute from the inspector seems to fix this, so I assume that this is happening because of the sandbox attribute.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/399824f2-395c-41e7-abff-6db15686f62en%40googlegroups.com.

Mohammad Rahmani

unread,
Apr 11, 2021, 6:27:37 AM4/11/21
to tiddl...@googlegroups.com
Hi Jeremy!



On Sun, Apr 11, 2021 at 1:59 PM Jeremy Ruston <jeremy...@gmail.com> wrote:
Hi Mark

As you suggest, rolling your own iframe with something like this macro might be workable in some situations:

\define non-sandboxed-iframe(title)
<iframe src={{{ [<title>get[_canonical_uri]] }}}></iframe>
\end

In terms of improving core support, an obvious solution would be some sort of “_sandbox” field on text/html tiddlers, but that doesn’t quite work because the parsing architecture is based around parsing chunks of text with a MIME type, and not necessarily parsing actual tiddlers.

So, I think the best we can do might be to provide a global hidden setting, which I’ve added for the prerelease here:


Seems one angle bracket is missed in above tiddler
<.from-version "5.1.24">>  should be <<.from-version "5.1.24">> 

 

Best wishes

Jeremy.


On 11 Apr 2021, at 04:46, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:

If you try to display an HTML page inside a _canonical_uri, it won't use the external CSS page because (I think) of the sandbox attribute. Other than hacking the code, or rolling your own iframe, is there some way to get the iframe to display properly?

Use case. I would like to off-load article-size tiddlers to their own HTML pages, allowing them to be viewed inside a _canonical_uri tiddler. Unfortunately, the formatting is broken because the page refuses to use the accompanying spreadsheet. Manually removing the sandbox attribute from the inspector seems to fix this, so I assume that this is happening because of the sandbox attribute.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/399824f2-395c-41e7-abff-6db15686f62en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Jeremy Ruston

unread,
Apr 11, 2021, 6:32:15 AM4/11/21
to tiddl...@googlegroups.com
Thanks Mohammad, the fix should be up in a few minutes,

Best wishes

Jeremy


On 11 Apr 2021, at 11:27, Mohammad Rahmani <mohammad...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages