Created
July 23, 2014 06:13
-
-
Save hedgerh/cdb1e7b0689d14ab1185 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Content script for the Soundcloud Following page. | |
| */ | |
| (function() { | |
| // replace the user list with the following template | |
| document.onreadystatechange = function() { | |
| if (document.readyState === "complete") { | |
| setTimeout(function() { | |
| var contentDiv = document.querySelector('.usersList'); | |
| var parentDiv = document.querySelector('.g-main-scroll-area'); | |
| parentDiv.removeChild(contentDiv); | |
| chrome.runtime.sendMessage({ | |
| template: 'groups/groups' | |
| }, function(response) { | |
| var newDiv = document.createElement('div'); | |
| newDiv.innerHTML = response; | |
| parentDiv.insertBefore(newDiv, parentDiv.childNodes[0]); | |
| // angular needs to be bootstrapped manually | |
| var angularDiv = document.querySelector('body'); | |
| angularDiv.classList.add('ng-app'); | |
| angularDiv.classList.add('ng-csp'); | |
| angular.bootstrap(angularDiv, ['SESApp']); | |
| }); | |
| }, 2000); | |
| } | |
| }; | |
| }()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment