浏览代码

Add allowfullscreen param to web iframe service. Default value is allowed.

Jean-Baptiste Motto 4 年之前
父节点
当前提交
1c943e413d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tarteaucitron.services.js

+ 2 - 1
tarteaucitron.services.js

@@ -15,9 +15,10 @@ tarteaucitron.services.iframe = {
             var frame_title = tarteaucitron.fixSelfXSS(x.getAttribute("title")),
                 width = x.getAttribute("width"),
                 height = x.getAttribute("height"),
+                allowfullscreen = x.getAttribute("allowfullscreen"),
                 url = x.getAttribute("data-url");
 
-            return '<iframe title="' + frame_title + '" src="' + url + '" width="' + width + '" height="' + height + '" scrolling="no" allowtransparency allowfullscreen></iframe>';
+            return '<iframe title="' + frame_title + '" src="' + url + '" width="' + width + '" height="' + height + '" scrolling="no" allowtransparency' + (allowfullscreen == '0' ? '' : ' webkitallowfullscreen mozallowfullscreen allowfullscreen') + '></iframe>';
         });
     },
     "fallback": function () {