Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
asamuzaK committed Apr 14, 2024
1 parent 76e3d5a commit deb1b37
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 34 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@
"type": "module",
"dependencies": {
"commander": "^12.0.0",
"dompurify": "^3.0.10",
"url-sanitizer": "^1.0.2",
"webext-schema": "^5.2.10",
"dompurify": "^3.1.0",
"url-sanitizer": "^2.0.0",
"webext-schema": "^5.3.0",
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"addons-linter": "^6.24.0",
"addons-linter": "^6.25.0",
"c8": "^9.1.0",
"chai": "^5.1.0",
"copyfiles": "^2.4.1",
"esbuild": "^0.20.2",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.1",
"eslint-plugin-jsdoc": "^48.2.3",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-regexp": "^2.3.0",
"eslint-plugin-unicorn": "^51.0.1",
"html-validate": "^8.17.0",
"eslint-plugin-regexp": "^2.5.0",
"eslint-plugin-unicorn": "^52.0.0",
"html-validate": "^8.18.1",
"jsdom": "^24.0.0",
"mocha": "^10.3.0",
"mocha": "^10.4.0",
"npm-run-all": "^4.1.5",
"selery": "^0.0.10",
"sinon": "^17.0.1",
"stylelint": "^16.2.1",
"stylelint": "^16.3.1",
"stylelint-config-standard": "^36.0.0",
"typescript": "^5.4.2",
"undici": "^6.9.0"
"typescript": "^5.4.5",
"undici": "^6.13.0"
},
"scripts": {
"bundle": "npm-run-all -s bundle-*",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/purify/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DOMPurify
Copyright 2023 Dr.-Ing. Mario Heiderich, Cure53
Copyright 2024 Dr.-Ing. Mario Heiderich, Cure53

DOMPurify is free software; you can redistribute it and/or modify it under the
terms of either:
Expand Down
14 changes: 7 additions & 7 deletions src/lib/purify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"type": "git",
"url": "git://github.com/cure53/DOMPurify.git"
},
"version": "3.0.10",
"version": "3.1.0",
"origins": [
{
"file": "LICENSE",
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.0.10/LICENSE",
"cdn": "https://unpkg.com/dompurify@3.0.10/LICENSE"
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.1.0/LICENSE",
"cdn": "https://unpkg.com/dompurify@3.1.0/LICENSE"
},
{
"file": "purify.min.js",
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.0.10/dist/purify.min.js",
"cdn": "https://unpkg.com/dompurify@3.0.10/dist/purify.min.js"
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.1.0/dist/purify.min.js",
"cdn": "https://unpkg.com/dompurify@3.1.0/dist/purify.min.js"
},
{
"file": "purify.min.js.map",
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.0.10/dist/purify.min.js.map",
"cdn": "https://unpkg.com/dompurify@3.0.10/dist/purify.min.js.map"
"raw": "https://raw.githubusercontent.com/cure53/DOMPurify/3.1.0/dist/purify.min.js.map",
"cdn": "https://unpkg.com/dompurify@3.1.0/dist/purify.min.js.map"
}
]
}
4 changes: 2 additions & 2 deletions src/lib/purify/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/lib/purify/purify.min.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/lib/url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
"url": "https://github.com/asamuzaK/urlSanitizer.git"
},
"type": "module",
"version": "1.0.2",
"version": "2.0.0",
"origins": [
{
"file": "LICENSE",
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v1.0.2/LICENSE",
"cdn": "https://unpkg.com/url-sanitizer@1.0.2/LICENSE"
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v2.0.0/LICENSE",
"cdn": "https://unpkg.com/url-sanitizer@2.0.0/LICENSE"
},
{
"file": "url-sanitizer-wo-dompurify.min.js",
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v1.0.2/dist/url-sanitizer-wo-dompurify.min.js",
"cdn": "https://unpkg.com/url-sanitizer@1.0.2/dist/url-sanitizer-wo-dompurify.min.js"
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v2.0.0/dist/url-sanitizer-wo-dompurify.min.js",
"cdn": "https://unpkg.com/url-sanitizer@2.0.0/dist/url-sanitizer-wo-dompurify.min.js"
},
{
"file": "url-sanitizer-wo-dompurify.min.js.map",
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v1.0.2/dist/url-sanitizer-wo-dompurify.min.js.map",
"cdn": "https://unpkg.com/url-sanitizer@1.0.2/dist/url-sanitizer-wo-dompurify.min.js.map"
"raw": "https://raw.githubusercontent.com/asamuzaK/urlSanitizer/v2.0.0/dist/url-sanitizer-wo-dompurify.min.js.map",
"cdn": "https://unpkg.com/url-sanitizer@2.0.0/dist/url-sanitizer-wo-dompurify.min.js.map"
}
]
}
2 changes: 1 addition & 1 deletion src/lib/url/url-sanitizer-wo-dompurify.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/lib/url/url-sanitizer-wo-dompurify.min.js.map

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions src/mjs/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,44 @@ export const warmupTab = async tabId => {
}
};

/**
* capture visible tab
* @param {number} windowId - window ID
* @param {object} opt - options
* @returns {Promise.<?string>} - data URL
*/
export const captureVisibleTab = async (windowId, opt) => {
const info = await runtime.getBrowserInfo();
let isGranted;
if (info.vender === 'Mozilla') {
const browserVersion = parseFloat(info.version);
isGranted = (browserVersion >= 126 && await isPermissionGranted({
permissions: ['activeTab']
})) || await isPermissionGranted({
origins: ['<all_urls>']
});
} else {
isGranted = await isPermissionGranted({
permissions: ['activeTab']
}) || await isPermissionGranted({
origins: ['<all_urls>']
});
}
let url;
if (isGranted) {
if (!Number.isInteger(windowId)) {
windowId = windows.WINDOW_ID_CURRENT;
}
if (!opt) {
opt = {
format: 'png'
};
}
url = await tabs.captureVisibleTab(windowId, opt);
}
return url ?? null;
};

/**
* is tab
* @param {*} tabId - tab ID
Expand Down

0 comments on commit deb1b37

Please sign in to comment.