Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactivate background on popup open #41

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions chrome-extension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
// some declarations just to make linters stop complaining
/**
* @class chrome
* @property extension.getBackgroundPage
* @property chrome.extension.getURL
* @property browserAction.setBadgeText
* @property browserAction.setIcon
* @property browserAction.setTitle
* @property extension.getURL
* @property runtime.getManifest
* @property runtime.getBackgroundPage
* @property runtime.onMessage.addListener
* @property tabs.onActivated
* @property tabs.sendMessage
* @property browserAction.setBadgeText
* @property chrome.browserAction.setIcon
* @property chrome.browserAction.setTitle
*/

class Popup {

constructor () {
const background = chrome.extension.getBackgroundPage();
chrome.runtime.getBackgroundPage(this.init.bind(this));
}

init(background) {
this.fullUrlRegex = /^https?:\/\//;

/** @type {Witchcraft} */
Expand Down
11 changes: 0 additions & 11 deletions chrome-extension/witchcraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
background-persistent mode, a single instance will run, guaranteed not to leave memory and thus keeping its state.
*/

// some declarations just to make linters stop complaining
/**
* @class chrome
* @property runtime.onMessage.addListener
* @property chrome.extension.getURL
* @property tabs.onActivated
* @property tabs.sendMessage
* @property browserAction.setBadgeText
* @property chrome.browserAction.setIcon
* @property chrome.browserAction.setTitle
*/
/**
* // https://developer.chrome.com/extensions/tabs#type-Tab
* @class Tab
Expand Down