解决某些网页flash播放器点击全屏无效的问题 (请求全屏已拒绝,至少一个文档包含的元素不是一个 iframe,或没有"allowfullscreen"属性。 index TypeError: The expression cannot be converted to return the specified type.)
当前为
// ==UserScript==
// @name Flash iframe allowfullscreen
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 解决某些网页flash播放器点击全屏无效的问题 (请求全屏已拒绝,至少一个文档包含的元素不是一个 iframe,或没有"allowfullscreen"属性。 index TypeError: The expression cannot be converted to return the specified type.)
// @author greasyfork baster
// @match *://*/*
// @run-at document-end
// @grant none
// ==/UserScript==
(function() {
'use strict';
var iframes = document.getElementsByTagName("iframe");
for (var i = 0; i < iframes.length; i++) {
iframes[i].setAttribute("allowfullscreen",true);
//console.log("set iframe allowfullscreen");
}
})();