Skip to content

Instantly share code, notes, and snippets.

@MeoMix
Created July 21, 2015 01:16
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 MeoMix/242bb5676b2246e564c1 to your computer and use it in GitHub Desktop.
Save MeoMix/242bb5676b2246e564c1 to your computer and use it in GitHub Desktop.
// Append a script to the page which will intercept YouTube's server requests and post messages out of the iframe with details about those requests.
// Needs to be an injected script because content scripts are sandboxed in such a way that they do not share variables with appended scripts.
this.injectInterceptorScript = function() {
var interceptorScript = document.createElement('script');
interceptorScript.src = chrome.runtime.getURL('js/inject/interceptor.js');
document.head.appendChild(interceptorScript);
}.bind(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment