Skip to content

Preview should be javascript-sandboxed #10

Closed
scor opened this Issue May 21, 2012 · 4 comments

2 participants

@scor
RDFa Community Group member
scor commented May 21, 2012

While trying some HTML from Drupal in Play, I found it sometimes doesn't return the expected triples. I've isolated the bug to be coming from a script element in <head>. To reproduce, try the following snippet in Play and note that no triples are generated for the RDFa inside body (while pyRDFa and Gregg's distiller do generated the expected triples).

<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" src="http://example.org/misc.js"></script>
</head>
<body>
  <span vocab="http://schema.org/" typeof="Document">
    <a property="url" href="http://www.w3.org/TR/rdfa-primer/">
      <span property="title">RDFa 1.1 Primer</span></a>.
  </span>
</body>
</html>
@alexmilowski

Grrr... OK. Those links had angle brackets around them but github interpreted them as links.

@alexmilowski

I see triples now in Chrome. The URI http://example.org/misc.js redirects to an HTML page and there is an exception from syntax errors while processing that page as Javascript. It may be that different browser/os combinations stop execution due to that exception.

@scor scor added a commit that referenced this issue Jan 22, 2013
@scor scor Fix issue #10: sandbox the preview iframe so that its javascript does…
… not conflict with parent window javascript
a7a3b63
@scor
RDFa Community Group member
scor commented Jan 22, 2013

fixed and deployed http://rdfa.info/play/

@scor scor closed this Jan 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.