Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Mar 26, 2021
1 parent be327f1 commit 29a8dfa
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion addon/actions/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function createSettingsMenu() {
browser.menus.create({
id: 'open_settings',
title: 'Open settings',
icons: { '16': 'assets/logo-native.svg' },
icons: { 16: 'assets/logo-native.svg' },
onclick: () => browser.runtime.openOptionsPage(),
contexts: ['browser_action'],
})
Expand Down
4 changes: 1 addition & 3 deletions addon/actions/snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ async function createSnapshot() {
}

currentSnapshot = {
id: Math.random()
.toString(16)
.replace('0.', Date.now().toString(16)),
id: Math.random().toString(16).replace('0.', Date.now().toString(16)),
time: Date.now(),
containersById,
panels: panels_v4,
Expand Down
2 changes: 1 addition & 1 deletion src/page.group/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let pinTab
let tabs = []
let groupLen, groupParentId

void (async function() {
void (async function () {
let { settings, cssVars } = await browser.storage.local.get({
settings: DEFAULT_SETTINGS,
cssVars: {},
Expand Down
2 changes: 1 addition & 1 deletion src/page.url/url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DEFAULT_SETTINGS, CUSTOM_CSS_VARS } from '../../addon/defaults'

void (async function() {
void (async function () {
let linkEl = document.getElementById('url')
let copyBtnEl = document.getElementById('copy_btn')

Expand Down
2 changes: 1 addition & 1 deletion src/popup.proxy/proxy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DEFAULT_SETTINGS, CUSTOM_CSS_VARS } from '../../addon/defaults'

void (async function() {
void (async function () {
let checkInfoBtnEl = document.getElementById('btn_check_ip')
let confBtnEl = document.getElementById('btn_conf')
let ipValueEl = document.getElementById('info_ip')
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/actions/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function createNativeOption(ctx, option, parentId, parentName) {
optProps.title = optProps.title[0].toUpperCase() + optProps.title.slice(1)
}

if (icon) optProps.icons = { '16': icon }
if (icon) optProps.icons = { 16: icon }
optProps.onclick = () => {
if (typeof option.action === 'string') {
if (!option.args) Actions[option.action]()
Expand Down
5 changes: 1 addition & 4 deletions src/sidebar/actions/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1294,10 +1294,7 @@ async function clearTabsCookies(tabIds) {
tab.loading = true

let url = new URL(tab.url)
let domain = url.hostname
.split('.')
.slice(-2)
.join('.')
let domain = url.hostname.split('.').slice(-2).join('.')

if (!domain) {
tab.loading = 'err'
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default new Vue({
mounted() {
Actions.updateSidebarWidth()
Actions.updateFontSize()
Store.watch(Object.getOwnPropertyDescriptor(State, 'fontSize').get, function() {
Store.watch(Object.getOwnPropertyDescriptor(State, 'fontSize').get, function () {
Actions.updateFontSize()
})
},
Expand Down

0 comments on commit 29a8dfa

Please sign in to comment.