Skip to content

Commit

Permalink
Merge pull request #205 from ator-dev/upgrade-dev-dependencies
Browse files Browse the repository at this point in the history
Upgrade dev dependencies
  • Loading branch information
ator-dev authored Jan 24, 2025
2 parents 58c8fdb + aad6c11 commit 77c6414
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Mark My Search",
"type": "module",
"scripts": {
"icons-convert": "bash -c 'mkdir -p icons/dist; SIZES=(16 32 48 64 96 128 240 300); for SIZE in ${SIZES[@]}; do inkscape icons/mms.svg -w $SIZE -h $SIZE -o icons/dist/mms-${SIZE}.png; done; SIZES=(32); for SIZE in ${SIZES[@]}; do inkscape icons/mms-off.svg -w $SIZE -h $SIZE -o icons/dist/mms-off-${SIZE}.png; done'",
"icons-convert": "bash -c 'mkdir -p icons/dist; SIZES=(16 32 48 64 96 128 240 300); for SIZE in ${SIZES[@]}; do npx sharp -i icons/mms.svg -o icons/dist/mms-${SIZE}.png resize $SIZE $SIZE & done; SIZES=(32); for SIZE in ${SIZES[@]}; do npx sharp -i icons/mms-off.svg -o icons/dist/mms-off-${SIZE}.png resize $SIZE $SIZE & done; wait'",
"scripts-build": "rm --recursive dist; tsc --project tsconfig.json",
"prepare-firefox": "ln --force --symbolic platform/firefox/manifest.json manifest.json",
"prepare-chromium": "ln --force --symbolic platform/chromium/manifest.json manifest.json",
Expand All @@ -25,12 +25,12 @@
},
"homepage": "https://github.com/searchmarkers/mark-my-search#readme",
"devDependencies": {
"@types/chrome": "0.0.253",
"@types/firefox-webext-browser": "120.0.0",
"eslint": "9.5.0",
"globals": "^15.6.0",
"inkscape": "3.1.1",
"typescript": "5.5.2",
"typescript-eslint": "8.0.1"
"@types/chrome": "0.0.299",
"@types/firefox-webext-browser": "120.0.4",
"eslint": "9.18.0",
"globals": "15.14.0",
"sharp-cli": "5.1.0",
"typescript": "5.7.3",
"typescript-eslint": "8.21.0"
}
}
6 changes: 3 additions & 3 deletions src/background.mts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const injectIntoTabs = () => new Promise<void>(resolve => {
* Registers items to selectively appear in context menus, if not present, to serve as shortcuts for managing the extension.
*/
const createContextMenuItems = () => {
if (compatibility.browser === "chromium" && chrome.contextMenus.onClicked["hasListeners"]()) {
if ("hasListeners" in chrome.contextMenus.onClicked && chrome.contextMenus.onClicked.hasListeners()) {
return;
}
chrome.contextMenus.removeAll();
Expand Down Expand Up @@ -545,8 +545,8 @@ const toggleHighlightsInTab = async (tabId: number, toggleHighlightsOn?: boolean
};

chrome.commands.onCommand.addListener(async commandString => {
if (commandString === "open-popup") {
(chrome.action["openPopup"] ?? (() => undefined))();
if (commandString === "open-popup" && "openPopup" in chrome.action) {
chrome.action.openPopup();
}
const [ tab ] = await chrome.tabs.query({ active: true, lastFocusedWindow: true });
const tabId = tab.id!; // `tab.id` is always defined for this case.
Expand Down
2 changes: 1 addition & 1 deletion src/modules/namespace/normalize.mts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ chrome.tabs.get = (compatibility.browser === "chromium")

chrome.search["search"] = (compatibility.browser === "chromium")
? (options: { query: string, tabId: number }) =>
chrome.search["query"]({ text: options.query, tabId: options.tabId }, () => undefined)
chrome.search.query({ text: options.query, tabId: options.tabId }, () => undefined)
: browser.search.search
;

Expand Down
5 changes: 4 additions & 1 deletion src/pages/options-new.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const getControlOptionTemp = <ConfigK extends ConfigKey>(
(await chrome.commands.getAll())
.find(commandOther => commandOther.name === details?.command?.name)?.shortcut?.split("+") ?? []
).join("+") : undefined,
forInput: details?.command?.name && (chrome.commands["update"] || (globalThis["browser"] && browser.commands["update"]))
forInput: (
details?.command?.name
&& ("update" in chrome.commands || ("browser" in globalThis && "update" in browser.commands))
)
? (input, getText, setFloatingText) => forInput(input, getText, setFloatingText, details!.command!.name!)
: undefined,
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/startpage.mts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ You can always activate ${Manifest.getName()} by opening its popup (from the 'ex
// Allow the user to try out the extension by searching for the query string, if any, they entered into the input.
// Prefer highlighting within the startpage, fallback to searching with their default search provider.
onClick: (messageText, formFields, onSuccess) => {
chrome.search["query"]({
chrome.search.query({
disposition: "NEW_TAB",
text: messageText,
}, onSuccess);
Expand Down

0 comments on commit 77c6414

Please sign in to comment.