Skip to content

Instantly share code, notes, and snippets.

@almino
Last active March 15, 2017 19:38
Show Gist options
  • Save almino/31a2812709849413ed899133b6c02b0c to your computer and use it in GitHub Desktop.
Save almino/31a2812709849413ed899133b6c02b0c to your computer and use it in GitHub Desktop.
Tampermonkey Browser-sync
// ==UserScript==
// @name Browser-sync append script
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Insert a script tag on a document
// @author Almino Melo <almino.melo@gmail.com>
// @match http://localhost:3000/*
// @match http://200.129.37.8:3000/*
// @require https://code.jquery.com/jquery-3.1.1.min.js
// @grant none
// ==/UserScript==
$(document).ready(function() {
'use strict';
var src = "http://HOST:PORT/browser-sync/browser-sync-client.js?v=2.18.6".replace("HOST", location.hostname).replace("PORT", location.port);
jQuery.getScript(src, function() { $(document.body).append(this); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment