Forked from vanyakosmos/github-html-preview-monkey.js
Created
August 28, 2019 16:54
-
-
Save jkaunert/efca9f3495348314fc3cd3fa89714f6f to your computer and use it in GitHub Desktop.
Script for Tampermonkey that adds 'view' to the actions menu beside 'row', 'blame' and 'history' buttons and allow you to preview rendered .html pages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Github html preview | |
// @author https://github.com/vaniakosmos | |
// @version 1.0 | |
// @description Shortcut for htmlpreview.github.io | |
// @match https://github.com/**/*.html | |
// @grant none | |
// @require http://code.jquery.com/jquery-3.2.1.min.js | |
// ==/UserScript== | |
$(document).ready(function() { | |
var viewBtn = $('<a>') | |
.attr('href', 'http://htmlpreview.github.io/?' + window.location.href) | |
.attr('class', 'btn btn-sm BtnGroup-item') | |
.html('Html preview'); | |
$('.file-actions').find('.BtnGroup').append(viewBtn); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment