Skip to content

Instantly share code, notes, and snippets.

@gawel
Created November 25, 2012 22:00
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 gawel/4145587 to your computer and use it in GitHub Desktop.
Save gawel/4145587 to your computer and use it in GitHub Desktop.
Automaticaly use proxfree for youtube
// ==UserScript==
// @name proxfree youtube
// @namespace proxfree
// @include http://www.youtube.com/*
// @include https://www.youtube.com/*
// @include *proxfree*
// @version 1
// ==/UserScript==
//
if (/.*proxfree.*/.exec(window.location.href)) {
if (/.*orig.*/.exec(window.location.href)) {
var url = window.location.href.split('orig=')[1];
document.getElementsByTagName('input')[0].setAttribute('value', url);
document.getElementsByTagName('form')[0].submit();
} else {
document.getElementById('pfproxy').setAttribute('style', 'display:none;');
}
} else if (/.*youtube.*/.exec(window.location.href)) {
window.location.href = 'http://www.proxfree.com/?orig=' + window.location.href.split('&')[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment