Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkaunert/efca9f3495348314fc3cd3fa89714f6f to your computer and use it in GitHub Desktop.
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.
// ==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