Skip to content

Instantly share code, notes, and snippets.

@cletusc
Created July 30, 2014 02:38
Show Gist options
  • Save cletusc/3934632a2cf0a36fd0fb to your computer and use it in GitHub Desktop.
Save cletusc/3934632a2cf0a36fd0fb to your computer and use it in GitHub Desktop.
Tests externally embedding a userscript in the page to trigger an install. See https://github.com/cletusc/Userscript--Twitch-Chat-Emotes/issues/52
// ==UserScript==
// @name Embedding Twitch Chat Emotes as userscript
// @namespace #Cletus
// @description Tests externally embedding a userscript in the page to trigger an install. See https://github.com/cletusc/Userscript--Twitch-Chat-Emotes/issues/52
// @include http://*.twitch.tv/*
// @version 1
// @grant none
// ==/UserScript==
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://rawgit.com/cletusc/Userscript--Twitch-Chat-Emotes/master/script.user.js';
var head = document.querySelector('head');
if (head) {
head.appendChild(script);
console.log('Appended script--did it trigger an install?')
}
else {
console.error('Could not find `head`.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment