CH Reload Frame Button

Adds a reload button on pages loaded in an iframe/frame. For more convenient access than the right-click menu, or for browser versions which don't have that menu command. Also shows the frame's URL in the button's mouseover text.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        CH Reload Frame Button
// @author      clickhappier
// @namespace   clickhappier
// @description Adds a reload button on pages loaded in an iframe/frame. For more convenient access than the right-click menu, or for browser versions which don't have that menu command. Also shows the frame's URL in the button's mouseover text.
// @version     1.0c
// @include     *
// @exclude     http://platform.twitter.com/*
// @exclude     https://platform.twitter.com/*
// @exclude     http://www.facebook.com/*
// @exclude     https://www.facebook.com/*
// @exclude     http://www.youtube.com/embed/*
// @exclude     https://www.youtube.com/embed/*
// @exclude     http://player.vimeo.com/*
// @exclude     https://player.vimeo.com/*
// @require     http://code.jquery.com/jquery-latest.min.js
// @grant       GM_log
// ==/UserScript==


// if page is loaded in an iframe/frame
if ( window.location != window.parent.location ) 
{
    // add a reload button, if page doesn't already have one from mmmturkeybacon's script for Google-hosted MTurk HITs
    if ( $('input[type="button"][value="Reload"]').length < 1 )
    {
        // adapted from https://greasyfork.org/en/scripts/10449-mmmturkeybacon-google-iframe-reload-button/
        var button_holder = document.createElement("DIV");
        button_holder.style.cssText = "position: fixed; top: 0px; right: 0px; z-index: 20;";
        button_holder.innerHTML = '<input type="button" onclick="window.location.reload(true)" value="&#8635;" id="CHReloadFrame" style="font-size:150%;" title="CH Reload Frame: ' + window.location + '" />';
        document.body.insertBefore(button_holder, document.body.firstChild);
    }
}