browser-extension-settings 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common.ts +4 -1
- package/lib/settings.ts +7 -2
- package/lib/style.scss +9 -3
- package/package.json +3 -3
package/lib/common.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export const besVersion =
|
|
1
|
+
export const besVersion = 18
|
|
2
2
|
export const openButton = `<svg viewBox="0 0 60.2601318359375 84.8134765625" version="1.1" xmlns="http://www.w3.org/2000/svg" class=" glyph-box" style="height: 9.62969px; width: 6.84191px;"><g transform="matrix(1 0 0 1 -6.194965820312518 77.63671875)"><path d="M66.4551-35.2539C66.4551-36.4746 65.9668-37.5977 65.0391-38.4766L26.3672-76.3672C25.4883-77.1973 24.4141-77.6367 23.1445-77.6367C20.6543-77.6367 18.7012-75.7324 18.7012-73.1934C18.7012-71.9727 19.1895-70.8496 19.9707-70.0195L55.5176-35.2539L19.9707-0.488281C19.1895 0.341797 18.7012 1.41602 18.7012 2.68555C18.7012 5.22461 20.6543 7.12891 23.1445 7.12891C24.4141 7.12891 25.4883 6.68945 26.3672 5.81055L65.0391-32.0312C65.9668-32.959 66.4551-34.0332 66.4551-35.2539Z"></path></g></svg>`
|
|
3
3
|
export const openInNewTabButton = `<svg viewBox="0 0 72.127685546875 72.2177734375" version="1.1" xmlns="http://www.w3.org/2000/svg" class=" glyph-box" style="height: 8.19958px; width: 8.18935px;"><g transform="matrix(1 0 0 1 -12.451127929687573 71.3388671875)"><path d="M84.5703-17.334L84.5215-66.4551C84.5215-69.2383 82.7148-71.1914 79.7852-71.1914L30.6641-71.1914C27.9297-71.1914 26.0742-69.0918 26.0742-66.748C26.0742-64.4043 28.1738-62.4023 30.4688-62.4023L47.4609-62.4023L71.2891-63.1836L62.207-55.2246L13.8184-6.73828C12.9395-5.85938 12.4512-4.73633 12.4512-3.66211C12.4512-1.31836 14.5508 0.878906 16.9922 0.878906C18.1152 0.878906 19.1895 0.488281 20.0684-0.439453L68.5547-48.877L76.6113-58.0078L75.7324-35.2051L75.7324-17.1387C75.7324-14.8438 77.7344-12.6953 80.127-12.6953C82.4707-12.6953 84.5703-14.6973 84.5703-17.334Z"></path></g></svg>`
|
|
4
|
+
export const settingButton = `<svg viewBox="0 0 16 16" version="1.1">
|
|
5
|
+
<path d="M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"></path>
|
|
6
|
+
</svg>`
|
package/lib/settings.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
parseInt10,
|
|
15
15
|
removeEventListener,
|
|
16
16
|
runWhenBodyExists,
|
|
17
|
+
runWhenHeadExists,
|
|
17
18
|
} from "browser-extension-utils"
|
|
18
19
|
import styleText from "data-text:./style.scss"
|
|
19
20
|
import { createSwitchOption } from "./switch"
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
activeExtensionList,
|
|
25
26
|
deactiveExtensionList,
|
|
26
27
|
} from "./extension-list"
|
|
27
|
-
import { besVersion,
|
|
28
|
+
import { besVersion, settingButton } from "./common"
|
|
28
29
|
|
|
29
30
|
const prefix = "browser_extension_settings_"
|
|
30
31
|
|
|
@@ -454,6 +455,8 @@ function addSideMenu() {
|
|
|
454
455
|
onclick() {
|
|
455
456
|
setTimeout(showSettings, 1)
|
|
456
457
|
},
|
|
458
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
459
|
+
innerHTML: settingButton,
|
|
457
460
|
})
|
|
458
461
|
}
|
|
459
462
|
|
|
@@ -512,7 +515,9 @@ export const initSettings = async (options: SettingsOptions) => {
|
|
|
512
515
|
})
|
|
513
516
|
|
|
514
517
|
settings = await getSettings()
|
|
515
|
-
|
|
518
|
+
runWhenHeadExists(() => {
|
|
519
|
+
addStyle(getSettingsStyle())
|
|
520
|
+
})
|
|
516
521
|
runWhenBodyExists(() => {
|
|
517
522
|
initExtensionList()
|
|
518
523
|
addSideMenu()
|
package/lib/style.scss
CHANGED
|
@@ -346,8 +346,8 @@
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
#browser_extension_side_menu {
|
|
349
|
-
min-height:
|
|
350
|
-
width:
|
|
349
|
+
min-height: 80px;
|
|
350
|
+
width: 30px;
|
|
351
351
|
opacity: 0;
|
|
352
352
|
position: fixed;
|
|
353
353
|
top: 80px;
|
|
@@ -364,9 +364,15 @@
|
|
|
364
364
|
cursor: pointer;
|
|
365
365
|
width: 24px;
|
|
366
366
|
height: 24px;
|
|
367
|
+
padding: 0;
|
|
367
368
|
border: none;
|
|
368
369
|
background-color: transparent;
|
|
369
|
-
background-image:
|
|
370
|
+
background-image: none;
|
|
371
|
+
|
|
372
|
+
svg {
|
|
373
|
+
width: 24px;
|
|
374
|
+
height: 24px;
|
|
375
|
+
}
|
|
370
376
|
}
|
|
371
377
|
|
|
372
378
|
#browser_extension_side_menu button:hover {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-extension-settings",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Settings module for developing browser extensions and userscripts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"homepage": "https://github.com/utags/browser-extension-settings#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"browser-extension-storage": "^0.1.2",
|
|
31
|
-
"browser-extension-utils": "^0.1.
|
|
31
|
+
"browser-extension-utils": "^0.1.15"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/chrome": "^0.0.
|
|
34
|
+
"@types/chrome": "^0.0.243",
|
|
35
35
|
"npm-run-all": "^4.1.5",
|
|
36
36
|
"prettier": "^2.8.8",
|
|
37
37
|
"typescript": "^5.1.6",
|