Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===========================================================
- //==================== C R E A T E D ========================
- //===========================================================
- chrome.tabs.onCreated.addListener(function(id, info, tab) {
- tabsHashAppend(id, info, tab);
- if (-1 != tab.url.indexOf("vk.com/im")) {
- if ("undefined" == typeof observer) {
- messageObserverLaunch();
- }
- }
- });
- //===========================================================
- //==================== U P D A T E D ========================
- //===========================================================
- chrome.tabs.onUpdated.addListener(function(id, info, tab){
- tabsHashAppend(id, info, tab);
- if (-1 != tab.url.indexOf("vk.com")) {
- if (-1 != tab.url.indexOf("/im")) {
- if ("undefined" == typeof observer) {
- messageObserverLaunch();
- }
- }
- if (-1 != tab.url.indexOf("/audio")) {
- console.log("audio list has been opened");
- var imgSkullUrl = chrome.extension.getURL("images/skull_18.png");
- chrome.tabs.query({ active: true, highlighted: true }, function(tabs) {
- chrome.tabs.sendMessage(tabs[0].id,
- {
- key: "audio",
- imgUrl: imgSkullUrl
- },
- function(rsp) {});
- });
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment