Changeset View
Changeset View
Standalone View
Standalone View
extension/extension.js
Show First 20 Lines • Show All 456 Lines • ▼ Show 20 Line(s) | 456 | if (incognitoTabs.length === 0) { | |||
---|---|---|---|---|---|
457 | console.log("no more incognito"); | 457 | console.log("no more incognito"); | ||
458 | port.postMessage({subsystem: "incognito", event: "hide" }); | 458 | port.postMessage({subsystem: "incognito", event: "hide" }); | ||
459 | } else { | 459 | } else { | ||
460 | console.log("still know", incognitoTabs.length, "incognito tabs"); | 460 | console.log("still know", incognitoTabs.length, "incognito tabs"); | ||
461 | } | 461 | } | ||
462 | } | 462 | } | ||
463 | }); | 463 | }); | ||
464 | 464 | | |||
465 | // Bookmarks Runner | ||||
466 | // ------------------------------------------------------------------------ | ||||
467 | // | ||||
468 | | ||||
469 | // only forward certain tab properties back to our host | ||||
470 | var whitelistedBookmarkProperties = [ | ||||
471 | "id", "url", "title" | ||||
472 | ]; | ||||
473 | | ||||
474 | addCallback("bookmarksrunner", "search", function (message) { | ||||
475 | chrome.bookmarks.search(message.query, function (bookmarks) { | ||||
476 | var filteredBookmarks = filterArrayObjects(bookmarks, whitelistedBookmarkProperties); | ||||
477 | | ||||
478 | port.postMessage({ | ||||
479 | subsystem: "bookmarksrunner", | ||||
480 | event: "gotBookmarks", | ||||
481 | bookmarks: filteredBookmarks | ||||
482 | }); | ||||
483 | }); | ||||
484 | }); | ||||
485 | | ||||
465 | // Tabs Runner | 486 | // Tabs Runner | ||
466 | // ------------------------------------------------------------------------ | 487 | // ------------------------------------------------------------------------ | ||
467 | // | 488 | // | ||
468 | addCallback("tabsrunner", "activate", function (message) { | 489 | addCallback("tabsrunner", "activate", function (message) { | ||
469 | var tabId = message.tabId; | 490 | var tabId = message.tabId; | ||
470 | 491 | | |||
471 | console.log("Tabs Runner requested to activate tab with id", tabId); | 492 | console.log("Tabs Runner requested to activate tab with id", tabId); | ||
472 | 493 | | |||
▲ Show 20 Lines • Show All 337 Lines • Show Last 20 Lines |