Bookmarklet: Append hidden iframe to page and load url

后端 未结 2 870

I have a bookmarklet for resetting my router. I just need to visit and let the page finish loading, then my router starts resetting.

javascript:(function(){w         


        
2条回答
  •  一个人的身影
    2020-12-31 22:05

    An even easier way would be to create a new IMG element:

    (function(){
        (new Image()).src = "http://192.168.0.1/goform/formReboot";
    })();
    

    As a bookmarklet:

    javascript:void((function(){(new Image()).src = "http://192.168.0.1/goform/formReboot";})());
    

    Or, if that doesn't work, here's the 'iframe' creator you requested:

    (function(){
        var i = document.createElement('iframe');
        i.style.display = 'none';
        i.onload = function() { i.parentNode.removeChild(i); };
        i.src = 'http://192.168.0.1/goform/formReboot';
        document.body.appendChild(i);
    })();
    

提交回复
热议问题