Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- debugger;
- chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
- chrome.browserAction.getTitle({tabId: tabs[0].id}, function(result) {
- console.log( tabId + "==Browser action title==", result);
- });
- });
- function click(e) {
- // console.log(e.target);
- chrome.tabs.executeScript(null, {
- code:"document.body.style.backgroundColor='" + e.target.className + "'"
- });
- window.close();
- }
- document.addEventListener('DOMContentLoaded', function () {
- var li = document.querySelectorAll('li');
- for (var i = 0; i < li.length; i++) {
- li[i].addEventListener('click', click);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement