Skip to content

Instantly share code, notes, and snippets.

@mhemmings
Created August 5, 2014 10:29
Show Gist options
  • Save mhemmings/63096dcef58b11a3b558 to your computer and use it in GitHub Desktop.
Save mhemmings/63096dcef58b11a3b558 to your computer and use it in GitHub Desktop.
Enable <a> links in Chrome extension pop-ups.
var aTags = document.getElementsByTagName('a');
for (var i = 0; i < aTags.length; i++) {
aTags[i].addEventListener('click', function (e) {
chrome.tabs.create({url: e.target.href});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment