Skip to content

Toggling console

gigafiga21 edited this page Aug 10, 2019 · 1 revision

Open

Here everything starts with user click on the action button. Background script located in CORE.JS file tracks this click and search object bound to tab where click appeared. If it was found and settings.type is set to "separate", new console tab will be opened. If settings.type was defined as "mixed" then signal CONSOLE_STATE will be sent to content script of current tab:

{
    type: "CONSOLE_STATE",
    command: "OPEN"
}

Close

There are 3 ways to close CONSOLE tab. If it was opened in separate page, then it can be closed by:

  • pressing on action button on CONSOLE or PAGE tab
  • closing tab with CONSOLE or PAGE

In that case onbeforeunload listener on content script will catch this event and send message to background.

{
    type: "CLOSED"
}

If tab is of MIXED type, click on action button will send to content script message

{
    type: "CONSOLE_STATE",
    command: "CLOSE"
}

Clone this wiki locally