You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues with JS and TextDocumentContentProvider #2912
alexandrudima correct, but we do not disable JS execution and I don't think we strip scripts. This was the state when we last discussed it and the intent is to switch from an <iframe> to a <webview>.
Doug Finke (@dfinke) the code is here: vscode\src\vs\workbench\parts\html\browser\htmlPreviewPart.ts
Doug Finke (@dfinke)alexandrudima
In the markdown preview the JavaScript from the above gist is executed as shown below. I was assuming that the html preview mostly mimics the mark down preview, but this is not the case and I did not succeed to execute scripts in the html preview.
Very cool. So a few tweaks to the html preview and vs code can be an interactive d3 pad.
I was looking at the htmlPreviewPart.ts to see if I could swap the iframe out, but I don't know if that would be enough. Maybe cloning the markdown preview is the place to start.
Maybe cloning the markdown preview is the place to start.
well this is where it started 😄, need to understand the differences with regard to JS handling in the two implementations.
As a workaround you could already do the d3 things using the markdown preview as is done in the twitter extension, but we should really get this to work.
The short Tweet on this drove questions in my direction. The snippet does not work in the 0.10.8 release. I know the Build conference is coming. Hopefully this can make it into the editor no too long after. It'd be a great feature.
Activity
alexdima commentedon Feb 11, 2016
I didn't implement this, but I think we use an
<iframe>to render the preview and we disable all<scripts>because they would run in the UI thread.fyi Johannes Rieken (@jrieken)
egamma commentedon Feb 11, 2016
alexandrudima correct, but we do not disable JS execution and I don't think we strip scripts. This was the state when we last discussed it and the intent is to switch from an
<iframe>to a<webview>.Doug Finke (@dfinke) the code is here:
vscode\src\vs\workbench\parts\html\browser\htmlPreviewPart.tsTo debug this pls see https://github.com/Microsoft/vscode/wiki/How-to-Contribute#development-workflow in the Debugging section. The htmlPreview code runs into the
rendererprocess.I'll look into this later, I see where you are going with your scenario and this is a interesting scenario.
egamma commentedon Feb 11, 2016
Doug Finke (@dfinke) alexandrudima
In the markdown preview the JavaScript from the above gist is executed as shown below. I was assuming that the html preview mostly mimics the mark down preview, but this is not the case and I did not succeed to execute scripts in the html preview.
dfinke commentedon Feb 11, 2016
Very cool. So a few tweaks to the html preview and vs code can be an interactive d3 pad.
I was looking at the
htmlPreviewPart.tsto see if I could swap theiframeout, but I don't know if that would be enough. Maybe cloning the markdown preview is the place to start.egamma commentedon Feb 12, 2016
well this is where it started 😄, need to understand the differences with regard to JS handling in the two implementations.
As a workaround you could already do the d3 things using the markdown preview as is done in the twitter extension, but we should really get this to work.
dfinke commentedon Feb 27, 2016
The short Tweet on this drove questions in my direction. The snippet does not work in the 0.10.8 release. I know the Build conference is coming. Hopefully this can make it into the editor no too long after. It'd be a great feature.
[-]TextDocumentContentProvider + d3[/-][+]Issues with JS and TextDocumentContentProvider[/+]jrieken commentedon Mar 7, 2016
I'll take a look - things are rendered in an iframe and script aren't blocked in anyway.
alexdima commentedon Mar 7, 2016
Johannes Rieken (@jrieken) Maybe we should use a
<webview>?tackle #3089 and #2912
jrieken commentedon Mar 8, 2016
The web view is past GA and tracked in #2414
bpasero commentedon Mar 21, 2016
👍