Change auconenable check to check size of autocontain object.

This commit is contained in:
Anton Vilhelm Ásgeirsson 2018-07-31 22:21:42 +00:00
parent e7524f191c
commit 3f0edaf202
2 changed files with 3 additions and 6 deletions

View file

@ -355,9 +355,6 @@ const DEFAULTS = o({
// If moodeindicator is enabled, containerindicator will color the border of the mode indicator with the container color.
containerindicator: "true",
// Enable Autocontainers
auconenable: "false",
// Autocontain directives create a container if it doesn't exist already.
auconcreatecontainer: "true",

View file

@ -71,9 +71,9 @@ export class AutoContain implements IAutoContain {
autoContain = async (
details: IDetails,
): Promise<browser.webRequest.BlockingResponse> => {
// Lets not break everyone's user experience ok?
let enabled = Config.get("auconenable")
if (enabled === "false") return { cancel: false }
// No autocontain directives, no nothing.
let aucons = Config.get("autocontain")
if (Object.keys(aucons).length === 0) return { cancel: false }
// Do not handle private tabs or invalid tabIds.
if (details.tabId === -1) return { cancel: false}