MCPcopy Index your code
hub / github.com/hoothin/UserScripts / reinitPlugin

Function reinitPlugin

FlashViewer-HTML5 Video/flashViewer.user.js:1262–1287  ·  view source on GitHub ↗
(plugin)

Source from the content-addressed store, hash-verified

1260
1261 // 重新初始化插件
1262 function reinitPlugin(plugin) {
1263 // 重载flash让参数生效
1264 // chrome firefox 切换display none就能引发重载,ie不行。
1265 // chrome firefox 删除后,添加进dom引发重载,ie不行
1266 // chrome 切换常规流绝对定位流引发重载,ie不行
1267
1268 var pluNS = plugin.nextSibling;
1269 var pluPN = plugin.parentNode;
1270 pluPN.removeChild(plugin);
1271
1272 // 加个延时,否则firefox无法重载
1273 setTimeout(function () {
1274 if(pluNS){
1275 pluPN.insertBefore(plugin, pluNS);
1276 }else{
1277 pluPN.appendChild(plugin);
1278 };
1279 }, 20);
1280
1281/* var pStyle = plugin.style;
1282 var oSDis = pStyle.display;
1283 pStyle.display = 'none';
1284 setTimeout(function () {
1285 pStyle.display = oSDis;
1286 }, 0); */
1287 };
1288
1289
1290 function reinitFlash() {

Callers 2

initializerFunction · 0.85
contentScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected