Add a trusted filter for iframe downloads (#836)

* add trusted helper to iframe downloads
This commit is contained in:
Henry Oswald 2018-08-22 14:47:15 +01:00 committed by GitHub
parent eeadd1e9bb
commit ab1848d0ae
2 changed files with 5 additions and 1 deletions

View file

@ -305,7 +305,7 @@ div.full-size.pdf(ng-controller="PdfController")
dbl-click-callback="syncToCode"
)
iframe(
ng-src="{{ pdf.url }}"
ng-src="{{ pdf.url | trusted }}"
ng-if="settings.pdfViewer == 'native'"
)

View file

@ -12,6 +12,10 @@ define [
# and then again on ack.
AUTO_COMPILE_DEBOUNCE = 2000
App.filter('trusted', ['$sce', ($sce)->
return (url)-> return $sce.trustAsResourceUrl(url);
])
App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
# enable per-user containers by default
perUserCompile = true