Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //text shown on the chrome extension popup
- function func(obj){
- document.querySelector("#io").innerHTML = obj[0].key1;
- }
- var queryInfo = {
- active: true,
- currentWindow: true
- };
- chrome.tabs.query(queryInfo, function(tabs){
- var tab = tabs[0];
- tab_title = tab.title;
- chrome.tabs.executeScript(tab.id, {
- code: 'var OBJ = {key1: document.querySelector("div_1").textContent, key2: document.querySelector("div_2").textContent}; OBJ'}
- ,func);
- });
Add Comment
Please, Sign In to add comment