From 4cb563ad4c61f6bfe0abddea7fc6a0c0b776246c Mon Sep 17 00:00:00 2001 From: Av32000 Date: Mon, 9 Jan 2023 18:34:16 +0100 Subject: [PATCH 1/2] Add Discord Shortcuts --- src/assets/logo-discord.png | Bin 0 -> 9471 bytes src/background.js | 255 ++++++++++++++++++------------------ 2 files changed, 129 insertions(+), 126 deletions(-) create mode 100644 src/assets/logo-discord.png diff --git a/src/assets/logo-discord.png b/src/assets/logo-discord.png new file mode 100644 index 0000000000000000000000000000000000000000..fadbea483efbe3b1fa37804ba2247b0374179146 GIT binary patch literal 9471 zcmXYXcOaYJ_y3b1V(;2DYq$0;QZVp6dEI!UhuT!+Y~%m{Q0eMuJO%&|;VTG$LI@vEpI15q z05_nkanB_1?e0>TpUH8%ICihaMSu(>#X$Ck_jN8WC@F*YEq5|n&y3>Z6b?*TH>l@i z|15Q8?ejF??05m$MCIiI2UNbn24m~tK89|pOPgr^zo{a)Dm{ekpWdk zFLWO_GV202tW3B>O^X(xMG#c-7ny#aWEJBie$<|1F$pXYvYYIm+`nrUx8{@q=zpqI zl^Y;kNru-u^@72s7Mz*cETL&E`LGX`G3T)+(De*r_{;wESq+l!OO!w9SDg`BmYkUe z{!wQJ2sv0!#pZU2Sq;&1WnBP5wz6V5F#LkSRT430Hi$7=0G6R8mHb2wI^eNK3iK3_ zSs_3N^Tg)yr{o?a+#s<&>_NrNV_q_N^!Ck!Gm3{7HvkUMq>HsO!i8%IKtjf;C0_d_pV~;l%yM(f@A27X|RILi)4myU5_AVS(Q;df4mU<9#+r z9ru8J`}~5IJgPwwYvJqQoio*=5YLaGJjy=vhlc|ihjl61l+V}^f~Cot?6uTi$oN5& z#SN<~L<1{P-q}<8uWGxf(1X~j@y+UA(NjIM+58BQPTz~{OQ0Z2Lqb9q*hq`r`|kpD zm(4>g;R)xfcRJwB7XArKJrvEow)t&~=;CE9CAzOHAbt>hKL=yX#8l(xJ?e%t1w>1e zdsNJ{?Qe|=Adaj;;+t_R7728sJq+)W31M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zUxrD^W{Kg_`1$q!-LQ}hisuIsZ&#;gi_|Vc)u|-^1N2EBp|;y7({G|exT57zuH!l( z4%QAnol|x}d4$U_y5>-s#Ct8!+&+{ExI*EMa2b1uC|!WG0}Wk(@Ytv8k|tc%RB?O@ zKS<&KT~SD`cv+bN&4y=zaw*XmZjnzi3hS8wHIXYxV`?N3@iM6zSK9OCE5iR5e_c4- zO3-2ez4;0g29^(;(DgTILx=T!H00M3DDJis8O#DfBAo{jR=MS literal 0 HcmV?d00001 diff --git a/src/background.js b/src/background.js index f3f3e74..79e3bb6 100644 --- a/src/background.js +++ b/src/background.js @@ -6,73 +6,76 @@ const clearActions = () => { getCurrentTab().then((response) => { actions = []; const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; - let muteaction = {title:"Mute tab", desc:"Mute the current tab", type:"action", action:"mute", emoji:true, emojiChar:"๐Ÿ”‡", keycheck:true, keys:['โŒฅ','โ‡ง', 'M']}; - let pinaction = {title:"Pin tab", desc:"Pin the current tab", type:"action", action:"pin", emoji:true, emojiChar:"๐Ÿ“Œ", keycheck:true, keys:['โŒฅ','โ‡ง', 'P']}; + let muteaction = { title: "Mute tab", desc: "Mute the current tab", type: "action", action: "mute", emoji: true, emojiChar: "๐Ÿ”‡", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'M'] }; + let pinaction = { title: "Pin tab", desc: "Pin the current tab", type: "action", action: "pin", emoji: true, emojiChar: "๐Ÿ“Œ", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'P'] }; if (response.mutedInfo.muted) { - muteaction = {title:"Unmute tab", desc:"Unmute the current tab", type:"action", action:"unmute", emoji:true, emojiChar:"๐Ÿ”ˆ", keycheck:true, keys:['โŒฅ','โ‡ง', 'M']}; + muteaction = { title: "Unmute tab", desc: "Unmute the current tab", type: "action", action: "unmute", emoji: true, emojiChar: "๐Ÿ”ˆ", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'M'] }; } if (response.pinned) { - pinaction = {title:"Unpin tab", desc:"Unpin the current tab", type:"action", action:"unpin", emoji:true, emojiChar:"๐Ÿ“Œ", keycheck:true, keys:['โŒฅ','โ‡ง', 'P']}; + pinaction = { title: "Unpin tab", desc: "Unpin the current tab", type: "action", action: "unpin", emoji: true, emojiChar: "๐Ÿ“Œ", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'P'] }; } actions = [ - {title:"New tab", desc:"Open a new tab", type:"action", action:"new-tab", emoji:true, emojiChar:"โœจ", keycheck:true, keys:['โŒ˜','T']}, - {title:"Bookmark", desc:"Create a bookmark", type:"action", action:"create-bookmark", emoji:true, emojiChar:"๐Ÿ“•", keycheck:true, keys:['โŒ˜','D']}, + { title: "New tab", desc: "Open a new tab", type: "action", action: "new-tab", emoji: true, emojiChar: "โœจ", keycheck: true, keys: ['โŒ˜', 'T'] }, + { title: "Bookmark", desc: "Create a bookmark", type: "action", action: "create-bookmark", emoji: true, emojiChar: "๐Ÿ“•", keycheck: true, keys: ['โŒ˜', 'D'] }, pinaction, - {title:"Fullscreen", desc:"Make the page fullscreen", type:"action", action:"fullscreen", emoji:true, emojiChar:"๐Ÿ–ฅ", keycheck:true, keys:['โŒ˜', 'Ctrl', 'F']}, + { title: "Fullscreen", desc: "Make the page fullscreen", type: "action", action: "fullscreen", emoji: true, emojiChar: "๐Ÿ–ฅ", keycheck: true, keys: ['โŒ˜', 'Ctrl', 'F'] }, muteaction, - {title:"Reload", desc:"Reload the page", type:"action", action:"reload", emoji:true, emojiChar:"โ™ป๏ธ", keycheck:true, keys:['โŒ˜','โ‡ง', 'R']}, - {title:"Help", desc:"Get help with Omni on GitHub", type:"action", action:"url", url:"https://github.com/alyssaxuu/omni", emoji:true, emojiChar:"๐Ÿค”", keycheck:false}, - {title:"Compose email", desc:"Compose a new email", type:"action", action:"email", emoji:true, emojiChar:"โœ‰๏ธ", keycheck:true, keys:['โŒฅ','โ‡ง', 'C']}, - {title:"Print page", desc:"Print the current page", type:"action", action:"print", emoji:true, emojiChar:"๐Ÿ–จ๏ธ", keycheck:true, keys:['โŒ˜', 'P']}, - {title:"New Notion page", desc:"Create a new Notion page", type:"action", action:"url", url:"https://notion.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-notion.png"), keycheck:false}, - {title:"New Sheets spreadsheet", desc:"Create a new Google Sheets spreadsheet", type:"action", action:"url", url:"https://sheets.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-sheets.png"), keycheck:false}, - {title:"New Docs document", desc:"Create a new Google Docs document", type:"action", action:"url", emoji:false, url:"https://docs.new", favIconUrl:chrome.runtime.getURL("assets/logo-docs.png"), keycheck:false}, - {title:"New Slides presentation", desc:"Create a new Google Slides presentation", type:"action", action:"url", url:"https://slides.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-slides.png"), keycheck:false}, - {title:"New form", desc:"Create a new Google Forms form", type:"action", action:"url", url:"https://forms.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-forms.png"), keycheck:false}, - {title:"New Medium story", desc:"Create a new Medium story", type:"action", action:"url", url:"https://story.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-medium.png"), keycheck:false}, - {title:"New GitHub repository", desc:"Create a new GitHub repository", type:"action", action:"url", url:"https://github.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-github.png"), keycheck:false}, - {title:"New GitHub gist", desc:"Create a new GitHub gist", type:"action", action:"url", url:"https://gist.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-github.png"), keycheck:false}, - {title:"New CodePen pen", desc:"Create a new CodePen pen", type:"action", action:"url", url:"https://pen.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-codepen.png"), keycheck:false}, - {title:"New Excel spreadsheet", desc:"Create a new Excel spreadsheet", type:"action", action:"url", url:"https://excel.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-excel.png"), keycheck:false}, - {title:"New PowerPoint presentation", desc:"Create a new PowerPoint presentation", type:"action", url:"https://powerpoint.new", action:"url", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-powerpoint.png"), keycheck:false}, - {title:"New Word document", desc:"Create a new Word document", type:"action", action:"url", url:"https://word.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-word.png"), keycheck:false}, - {title:"Create a whiteboard", desc:"Create a collaborative whiteboard", type:"action", action:"url", url:"https://whiteboard.new", emoji:true, emojiChar:"๐Ÿง‘โ€๐Ÿซ", keycheck:false}, - {title:"Record a video", desc:"Record and edit a video", type:"action", action:"url", url:"https://recording.new", emoji:true, emojiChar:"๐Ÿ“น", keycheck:false}, - {title:"Create a Figma file", desc:"Create a new Figma file", type:"action", action:"url", url:"https://figma.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-figma.png"), keycheck:false}, - {title:"Create a FigJam file", desc:"Create a new FigJam file", type:"action", action:"url", url:"https://figjam.new", emoji:true, emojiChar:"๐Ÿ–Œ", keycheck:false}, - {title:"Hunt a product", desc:"Submit a product to Product Hunt", type:"action", action:"url", url:"https://www.producthunt.com/posts/new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-producthunt.png"), keycheck:false}, - {title:"Make a tweet", desc:"Make a tweet on Twitter", type:"action", action:"url", url:"https://twitter.com/intent/tweet", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-twitter.png"), keycheck:false}, - {title:"Create a playlist", desc:"Create a Spotify playlist", type:"action", action:"url", url:"https://playlist.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-spotify.png"), keycheck:false}, - {title:"Create a Canva design", desc:"Create a new design with Canva", type:"action", action:"url", url:"https://design.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-canva.png"), keycheck:false}, - {title:"Create a new podcast episode", desc:"Create a new podcast episode with Anchor", type:"action", action:"url", url:"https://episode.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-anchor.png"), keycheck:false}, - {title:"Edit an image", desc:"Edit an image with Adobe Photoshop", type:"action", action:"url", url:"https://photo.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-photoshop.png"), keycheck:false}, - {title:"Convert to PDF", desc:"Convert a file to PDF", type:"action", action:"url", url:"https://pdf.new", emoji:true, emojiChar:"๐Ÿ“„", keycheck:false}, - {title:"Scan a QR code", desc:"Scan a QR code with your camera", type:"action", action:"url", url:"https://scan.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-qr.png"), keycheck:false}, - {title:"Add a task to Asana", desc:"Create a new task in Asana", type:"action", action:"url", url:"https://task.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-asana.png"), keycheck:false}, - {title:"Add an issue to Linear", desc:"Create a new issue in Linear", type:"action", action:"url", url:"https://linear.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-linear.png"), keycheck:false}, - {title:"Add a task to WIP", desc:"Create a new task in WIP", type:"action", action:"url", url:"https://todo.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-wip.png"), keycheck:false}, - {title:"Create an event", desc:"Add an event to Google Calendar", type:"action", action:"url", url:"https://cal.new", emoji:false, favIconUrl:chrome.runtime.getURL("assets/logo-calendar.png"), keycheck:false}, - {title:"Add a note", desc:"Add a note to Google Keep", type:"action", action:"url", emoji:false, url:"https://note.new", favIconUrl:chrome.runtime.getURL("assets/logo-keep.png"), keycheck:false}, - {title:"New meeting", desc:"Start a Google Meet meeting", type:"action", action:"url", emoji:false, url:"https://meet.new", favIconUrl:chrome.runtime.getURL("assets/logo-meet.png"), keycheck:false}, - {title:"Browsing history", desc:"Browse through your browsing history", type:"action", action:"history", emoji:true, emojiChar:"๐Ÿ—‚", keycheck:true, keys:['โŒ˜','Y']}, - {title:"Incognito mode", desc:"Open an incognito window", type:"action", action:"incognito", emoji:true, emojiChar:"๐Ÿ•ต๏ธ", keycheck:true, keys:['โŒ˜','โ‡ง', 'N']}, - {title:"Downloads", desc:"Browse through your downloads", type:"action", action:"downloads", emoji:true, emojiChar:"๐Ÿ“ฆ", keycheck:true, keys:['โŒ˜','โ‡ง', 'J']}, - {title:"Extensions", desc:"Manage your Chrome Extensions", type:"action", action:"extensions", emoji:true, emojiChar:"๐Ÿงฉ", keycheck:false, keys:['โŒ˜','D']}, - {title:"Chrome settings", desc:"Open the Chrome settings", type:"action", action:"settings", emoji:true, emojiChar:"โš™๏ธ", keycheck:true, keys:['โŒ˜',',']}, - {title:"Scroll to bottom", desc:"Scroll to the bottom of the page", type:"action", action:"scroll-bottom", emoji:true, emojiChar:"๐Ÿ‘‡", keycheck:true, keys:['โŒ˜','โ†“']}, - {title:"Scroll to top", desc:"Scroll to the top of the page", type:"action", action:"scroll-top", emoji:true, emojiChar:"๐Ÿ‘†", keycheck:true, keys:['โŒ˜','โ†‘']}, - {title:"Go back", desc:"Go back in history for the current tab", type:"action", action:"go-back", emoji:true, emojiChar:"๐Ÿ‘ˆ", keycheck:true, keys:['โŒ˜','โ†']}, - {title:"Go forward", desc:"Go forward in history for the current tab", type:"action", action:"go-forward", emoji:true, emojiChar:"๐Ÿ‘‰", keycheck:true, keys:['โŒ˜','โ†’']}, - {title:"Duplicate tab", desc:"Make a copy of the current tab", type:"action", action:"duplicate-tab", emoji:true, emojiChar:"๐Ÿ“‹", keycheck:true, keys:['โŒฅ','โ‡ง', 'D']}, - {title:"Close tab", desc:"Close the current tab", type:"action", action:"close-tab", emoji:true, emojiChar:"๐Ÿ—‘", keycheck:true, keys:['โŒ˜','W']}, - {title:"Close window", desc:"Close the current window", type:"action", action:"close-window", emoji:true, emojiChar:"๐Ÿ’ฅ", keycheck:true, keys:['โŒ˜','โ‡ง', 'W']}, - {title:"Manage browsing data", desc:"Manage your browsing data", type:"action", action:"manage-data", emoji:true, emojiChar:"๐Ÿ”ฌ", keycheck:true, keys:['โŒ˜','โ‡ง', 'Delete']}, - {title:"Clear all browsing data", desc:"Clear all of your browsing data", type:"action", action:"remove-all", emoji:true, emojiChar:"๐Ÿงน", keycheck:false, keys:['โŒ˜','D']}, - {title:"Clear browsing history", desc:"Clear all of your browsing history", type:"action", action:"remove-history", emoji:true, emojiChar:"๐Ÿ—‚", keycheck:false, keys:['โŒ˜','D']}, - {title:"Clear cookies", desc:"Clear all cookies", type:"action", action:"remove-cookies", emoji:true, emojiChar:"๐Ÿช", keycheck:false, keys:['โŒ˜','D']}, - {title:"Clear cache", desc:"Clear the cache", type:"action", action:"remove-cache", emoji:true, emojiChar:"๐Ÿ—„", keycheck:false, keys:['โŒ˜','D']}, - {title:"Clear local storage", desc:"Clear the local storage", type:"action", action:"remove-local-storage", emoji:true, emojiChar:"๐Ÿ“ฆ", keycheck:false, keys:['โŒ˜','D']}, - {title:"Clear passwords", desc:"Clear all saved passwords", type:"action", action:"remove-passwords", emoji:true, emojiChar:"๐Ÿ”‘", keycheck:false, keys:['โŒ˜','D']}, + { title: "Reload", desc: "Reload the page", type: "action", action: "reload", emoji: true, emojiChar: "โ™ป๏ธ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'R'] }, + { title: "Help", desc: "Get help with Omni on GitHub", type: "action", action: "url", url: "https://github.com/alyssaxuu/omni", emoji: true, emojiChar: "๐Ÿค”", keycheck: false }, + { title: "Compose email", desc: "Compose a new email", type: "action", action: "email", emoji: true, emojiChar: "โœ‰๏ธ", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'C'] }, + { title: "Print page", desc: "Print the current page", type: "action", action: "print", emoji: true, emojiChar: "๐Ÿ–จ๏ธ", keycheck: true, keys: ['โŒ˜', 'P'] }, + { title: "New Notion page", desc: "Create a new Notion page", type: "action", action: "url", url: "https://notion.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-notion.png"), keycheck: false }, + { title: "New Sheets spreadsheet", desc: "Create a new Google Sheets spreadsheet", type: "action", action: "url", url: "https://sheets.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-sheets.png"), keycheck: false }, + { title: "New Docs document", desc: "Create a new Google Docs document", type: "action", action: "url", emoji: false, url: "https://docs.new", favIconUrl: chrome.runtime.getURL("assets/logo-docs.png"), keycheck: false }, + { title: "New Slides presentation", desc: "Create a new Google Slides presentation", type: "action", action: "url", url: "https://slides.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-slides.png"), keycheck: false }, + { title: "New form", desc: "Create a new Google Forms form", type: "action", action: "url", url: "https://forms.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-forms.png"), keycheck: false }, + { title: "New Medium story", desc: "Create a new Medium story", type: "action", action: "url", url: "https://story.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-medium.png"), keycheck: false }, + { title: "New GitHub repository", desc: "Create a new GitHub repository", type: "action", action: "url", url: "https://github.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-github.png"), keycheck: false }, + { title: "New GitHub gist", desc: "Create a new GitHub gist", type: "action", action: "url", url: "https://gist.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-github.png"), keycheck: false }, + { title: "New CodePen pen", desc: "Create a new CodePen pen", type: "action", action: "url", url: "https://pen.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-codepen.png"), keycheck: false }, + { title: "New Excel spreadsheet", desc: "Create a new Excel spreadsheet", type: "action", action: "url", url: "https://excel.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-excel.png"), keycheck: false }, + { title: "New PowerPoint presentation", desc: "Create a new PowerPoint presentation", type: "action", url: "https://powerpoint.new", action: "url", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-powerpoint.png"), keycheck: false }, + { title: "New Word document", desc: "Create a new Word document", type: "action", action: "url", url: "https://word.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-word.png"), keycheck: false }, + { title: "Create a whiteboard", desc: "Create a collaborative whiteboard", type: "action", action: "url", url: "https://whiteboard.new", emoji: true, emojiChar: "๐Ÿง‘โ€๐Ÿซ", keycheck: false }, + { title: "Record a video", desc: "Record and edit a video", type: "action", action: "url", url: "https://recording.new", emoji: true, emojiChar: "๐Ÿ“น", keycheck: false }, + { title: "Create a Figma file", desc: "Create a new Figma file", type: "action", action: "url", url: "https://figma.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-figma.png"), keycheck: false }, + { title: "Create a FigJam file", desc: "Create a new FigJam file", type: "action", action: "url", url: "https://figjam.new", emoji: true, emojiChar: "๐Ÿ–Œ", keycheck: false }, + { title: "Hunt a product", desc: "Submit a product to Product Hunt", type: "action", action: "url", url: "https://www.producthunt.com/posts/new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-producthunt.png"), keycheck: false }, + { title: "Make a tweet", desc: "Make a tweet on Twitter", type: "action", action: "url", url: "https://twitter.com/intent/tweet", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-twitter.png"), keycheck: false }, + { title: "Create a playlist", desc: "Create a Spotify playlist", type: "action", action: "url", url: "https://playlist.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-spotify.png"), keycheck: false }, + { title: "Create a Canva design", desc: "Create a new design with Canva", type: "action", action: "url", url: "https://design.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-canva.png"), keycheck: false }, + { title: "Create a new podcast episode", desc: "Create a new podcast episode with Anchor", type: "action", action: "url", url: "https://episode.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-anchor.png"), keycheck: false }, + { title: "Edit an image", desc: "Edit an image with Adobe Photoshop", type: "action", action: "url", url: "https://photo.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-photoshop.png"), keycheck: false }, + { title: "Convert to PDF", desc: "Convert a file to PDF", type: "action", action: "url", url: "https://pdf.new", emoji: true, emojiChar: "๐Ÿ“„", keycheck: false }, + { title: "Scan a QR code", desc: "Scan a QR code with your camera", type: "action", action: "url", url: "https://scan.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-qr.png"), keycheck: false }, + { title: "Add a task to Asana", desc: "Create a new task in Asana", type: "action", action: "url", url: "https://task.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-asana.png"), keycheck: false }, + { title: "Add an issue to Linear", desc: "Create a new issue in Linear", type: "action", action: "url", url: "https://linear.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-linear.png"), keycheck: false }, + { title: "Add a task to WIP", desc: "Create a new task in WIP", type: "action", action: "url", url: "https://todo.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-wip.png"), keycheck: false }, + { title: "Create an event", desc: "Add an event to Google Calendar", type: "action", action: "url", url: "https://cal.new", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-calendar.png"), keycheck: false }, + { title: "Add a note", desc: "Add a note to Google Keep", type: "action", action: "url", emoji: false, url: "https://note.new", favIconUrl: chrome.runtime.getURL("assets/logo-keep.png"), keycheck: false }, + { title: "New meeting", desc: "Start a Google Meet meeting", type: "action", action: "url", emoji: false, url: "https://meet.new", favIconUrl: chrome.runtime.getURL("assets/logo-meet.png"), keycheck: false }, + { title: "Browsing history", desc: "Browse through your browsing history", type: "action", action: "history", emoji: true, emojiChar: "๐Ÿ—‚", keycheck: true, keys: ['โŒ˜', 'Y'] }, + { title: "Incognito mode", desc: "Open an incognito window", type: "action", action: "incognito", emoji: true, emojiChar: "๐Ÿ•ต๏ธ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'N'] }, + { title: "Downloads", desc: "Browse through your downloads", type: "action", action: "downloads", emoji: true, emojiChar: "๐Ÿ“ฆ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'J'] }, + { title: "Extensions", desc: "Manage your Chrome Extensions", type: "action", action: "extensions", emoji: true, emojiChar: "๐Ÿงฉ", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Chrome settings", desc: "Open the Chrome settings", type: "action", action: "settings", emoji: true, emojiChar: "โš™๏ธ", keycheck: true, keys: ['โŒ˜', ','] }, + { title: "Scroll to bottom", desc: "Scroll to the bottom of the page", type: "action", action: "scroll-bottom", emoji: true, emojiChar: "๐Ÿ‘‡", keycheck: true, keys: ['โŒ˜', 'โ†“'] }, + { title: "Scroll to top", desc: "Scroll to the top of the page", type: "action", action: "scroll-top", emoji: true, emojiChar: "๐Ÿ‘†", keycheck: true, keys: ['โŒ˜', 'โ†‘'] }, + { title: "Go back", desc: "Go back in history for the current tab", type: "action", action: "go-back", emoji: true, emojiChar: "๐Ÿ‘ˆ", keycheck: true, keys: ['โŒ˜', 'โ†'] }, + { title: "Go forward", desc: "Go forward in history for the current tab", type: "action", action: "go-forward", emoji: true, emojiChar: "๐Ÿ‘‰", keycheck: true, keys: ['โŒ˜', 'โ†’'] }, + { title: "Duplicate tab", desc: "Make a copy of the current tab", type: "action", action: "duplicate-tab", emoji: true, emojiChar: "๐Ÿ“‹", keycheck: true, keys: ['โŒฅ', 'โ‡ง', 'D'] }, + { title: "Close tab", desc: "Close the current tab", type: "action", action: "close-tab", emoji: true, emojiChar: "๐Ÿ—‘", keycheck: true, keys: ['โŒ˜', 'W'] }, + { title: "Close window", desc: "Close the current window", type: "action", action: "close-window", emoji: true, emojiChar: "๐Ÿ’ฅ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'W'] }, + { title: "Manage browsing data", desc: "Manage your browsing data", type: "action", action: "manage-data", emoji: true, emojiChar: "๐Ÿ”ฌ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'Delete'] }, + { title: "Clear all browsing data", desc: "Clear all of your browsing data", type: "action", action: "remove-all", emoji: true, emojiChar: "๐Ÿงน", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Clear browsing history", desc: "Clear all of your browsing history", type: "action", action: "remove-history", emoji: true, emojiChar: "๐Ÿ—‚", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Clear cookies", desc: "Clear all cookies", type: "action", action: "remove-cookies", emoji: true, emojiChar: "๐Ÿช", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Clear cache", desc: "Clear the cache", type: "action", action: "remove-cache", emoji: true, emojiChar: "๐Ÿ—„", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Clear local storage", desc: "Clear the local storage", type: "action", action: "remove-local-storage", emoji: true, emojiChar: "๐Ÿ“ฆ", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Clear passwords", desc: "Clear all saved passwords", type: "action", action: "remove-passwords", emoji: true, emojiChar: "๐Ÿ”‘", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Open Discord", desc: "Open Discord Webapp", type: "action", action: "url", url: "https://discord.com/app", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-discord.png") }, + { title: "Open Discord Doc", desc: "Open Discord API documentation", type: "action", action: "url", url: "https://discord.com/developers/docs/intro", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-discord.png") }, + { title: "Open Developer Portal", desc: "Open Discord Developer Portal", type: "action", action: "url", url: "https://discord.com/developers/applications", emoji: false, favIconUrl: chrome.runtime.getURL("assets/logo-discord.png") }, ]; if (!isMac) { @@ -94,10 +97,10 @@ const clearActions = () => { action.keys = ['Ctrl', 'H']; break; case "go-back": - action.keys = ['Alt','โ†']; + action.keys = ['Alt', 'โ†']; break; case "go-forward": - action.keys = ['Alt','โ†’'] + action.keys = ['Alt', 'โ†’'] break; case "scroll-top": action.keys = ['Home']; @@ -120,59 +123,59 @@ const clearActions = () => { // Open on install chrome.runtime.onInstalled.addListener((object) => { - // Inject Omni on install - const manifest = chrome.runtime.getManifest(); + // Inject Omni on install + const manifest = chrome.runtime.getManifest(); - const injectIntoTab = (tab) => { - const scripts = manifest.content_scripts[0].js; - const s = scripts.length; + const injectIntoTab = (tab) => { + const scripts = manifest.content_scripts[0].js; + const s = scripts.length; - for (let i = 0; i < s; i++) { - chrome.scripting.executeScript({ - target: { tabId: tab.id }, - files: [scripts[i]], - }); - } + for (let i = 0; i < s; i++) { + chrome.scripting.executeScript({ + target: { tabId: tab.id }, + files: [scripts[i]], + }); + } - chrome.scripting.insertCSS({ - target: { tabId: tab.id }, - files: [manifest.content_scripts[0].css[0]], - }); - }; + chrome.scripting.insertCSS({ + target: { tabId: tab.id }, + files: [manifest.content_scripts[0].css[0]], + }); + }; - // Get all windows - chrome.windows.getAll( - { - populate: true, - }, - (windows) => { - let currentWindow; - const w = windows.length; + // Get all windows + chrome.windows.getAll( + { + populate: true, + }, + (windows) => { + let currentWindow; + const w = windows.length; - for (let i = 0; i < w; i++) { - currentWindow = windows[i]; + for (let i = 0; i < w; i++) { + currentWindow = windows[i]; - let currentTab; - const t = currentWindow.tabs.length; + let currentTab; + const t = currentWindow.tabs.length; - for (let j = 0; j < t; j++) { - currentTab = currentWindow.tabs[j]; + for (let j = 0; j < t; j++) { + currentTab = currentWindow.tabs[j]; if (!currentTab.url.includes("chrome://") && !currentTab.url.includes("chrome-extension://") && !currentTab.url.includes("chrome.google.com")) { - injectIntoTab(currentTab); + injectIntoTab(currentTab); } - } - } - } - ); + } + } + } + ); - if (object.reason === "install") { - chrome.tabs.create({ url: "https://alyssax.com/omni/" }); - } + if (object.reason === "install") { + chrome.tabs.create({ url: "https://alyssax.com/omni/" }); + } }); // Check when the extension button is clicked chrome.action.onClicked.addListener((tab) => { - chrome.tabs.sendMessage(tab.id, {request: "open-omni"}); + chrome.tabs.sendMessage(tab.id, { request: "open-omni" }); }); // Listen for the open omni shortcut @@ -180,10 +183,10 @@ chrome.commands.onCommand.addListener((command) => { if (command === "open-omni") { getCurrentTab().then((response) => { if (!response.url.includes("chrome://") && !response.url.includes("chrome.google.com")) { - chrome.tabs.sendMessage(response.id, {request: "open-omni"}); + chrome.tabs.sendMessage(response.id, { request: "open-omni" }); } else { chrome.tabs.create({ - url: "./newtab.html" + url: "./newtab.html" }).then(() => { newtaburl = response.url; chrome.tabs.remove(response.id); @@ -216,8 +219,8 @@ const resetOmni = () => { getTabs(); getBookmarks(); var search = [ - {title:"Search", desc:"Search for a query", type:"action", action:"search", emoji:true, emojiChar:"๐Ÿ”", keycheck:false}, - {title:"Search", desc:"Go to website", type:"action", action:"goto", emoji:true, emojiChar:"๐Ÿ”", keycheck:false} + { title: "Search", desc: "Search for a query", type: "action", action: "search", emoji: true, emojiChar: "๐Ÿ”", keycheck: false }, + { title: "Search", desc: "Go to website", type: "action", action: "goto", emoji: true, emojiChar: "๐Ÿ”", keycheck: false } ]; actions = search.concat(actions); } @@ -243,9 +246,9 @@ const getTabs = () => { // Get bookmarks to populate in the actions const getBookmarks = () => { const process_bookmark = (bookmarks) => { - for (const bookmark of bookmarks) { + for (const bookmark of bookmarks) { if (bookmark.url) { - actions.push({title:bookmark.title, desc:"Bookmark", id:bookmark.id, url:bookmark.url, type:"bookmark", action:"bookmark", emoji:true, emojiChar:"โญ๏ธ", keycheck:false}) + actions.push({ title: bookmark.title, desc: "Bookmark", id: bookmark.id, url: bookmark.url, type: "bookmark", action: "bookmark", emoji: true, emojiChar: "โญ๏ธ", keycheck: false }) } if (bookmark.children) { process_bookmark(bookmark.children); @@ -290,9 +293,9 @@ const createBookmark = (tab) => { }); }) } -const muteTab = (mute) =>{ +const muteTab = (mute) => { getCurrentTab().then((response) => { - chrome.tabs.update(response.id, {"muted": mute}) + chrome.tabs.update(response.id, { "muted": mute }) }); } const reloadTab = () => { @@ -300,7 +303,7 @@ const reloadTab = () => { } const pinTab = (pin) => { getCurrentTab().then((response) => { - chrome.tabs.update(response.id, {"pinned": pin}) + chrome.tabs.update(response.id, { "pinned": pin }) }); } const clearAllData = () => { @@ -323,25 +326,25 @@ const clearAllData = () => { }); } const clearBrowsingData = () => { - chrome.browsingData.removeHistory({"since": 0}); + chrome.browsingData.removeHistory({ "since": 0 }); } -const clearCookies = () =>{ - chrome.browsingData.removeCookies({"since": 0}); +const clearCookies = () => { + chrome.browsingData.removeCookies({ "since": 0 }); } const clearCache = () => { - chrome.browsingData.removeCache({"since": 0}); + chrome.browsingData.removeCache({ "since": 0 }); } const clearLocalStorage = () => { - chrome.browsingData.removeLocalStorage({"since": 0}); + chrome.browsingData.removeLocalStorage({ "since": 0 }); } const clearPasswords = () => { - chrome.browsingData.removePasswords({"since": 0}); + chrome.browsingData.removePasswords({ "since": 0 }); } const openChromeUrl = (url) => { - chrome.tabs.create({url: 'chrome://'+url+'/'}); + chrome.tabs.create({ url: 'chrome://' + url + '/' }); } const openIncognito = () => { - chrome.windows.create({"incognito": true}); + chrome.windows.create({ "incognito": true }); } const closeWindow = (id) => { chrome.windows.remove(id); @@ -361,7 +364,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { switch (message.request) { case "get-actions": resetOmni(); - sendResponse({actions: actions}); + sendResponse({ actions: actions }); break; case "switch-tab": switchTab(message.tab); @@ -430,7 +433,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { closeCurrentTab(); break; case "search-history": - chrome.history.search({text:message.query, maxResults:0, startTime:0}).then((data) => { + chrome.history.search({ text: message.query, maxResults: 0, startTime: 0 }).then((data) => { data.forEach((action, index) => { action.type = "history"; action.emoji = true; @@ -438,11 +441,11 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { action.action = "history"; action.keyCheck = false; }); - sendResponse({history:data}); + sendResponse({ history: data }); }) return true; case "search-bookmarks": - chrome.bookmarks.search({query:message.query}).then((data) => { + chrome.bookmarks.search({ query: message.query }).then((data) => { // The index property of the bookmark appears to be causing issues, iterating separately... data.filter(x => x.index == 0).forEach((action, index) => { if (!action.url) { @@ -464,7 +467,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { action.action = "bookmark"; action.keyCheck = false; }) - sendResponse({bookmarks:data}); + sendResponse({ bookmarks: data }); }) return true; case "remove": @@ -476,7 +479,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { break; case "search": chrome.search.query( - {text:message.query} + { text: message.query } ) break; case "restore-new-tab": @@ -484,10 +487,10 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { break; case "close-omni": getCurrentTab().then((response) => { - chrome.tabs.sendMessage(response.id, {request: "close-omni"}); + chrome.tabs.sendMessage(response.id, { request: "close-omni" }); }); break; - } + } }); // Get actions From d52fbaf8578eea9bd6b2d650fbb6a31a9462cde1 Mon Sep 17 00:00:00 2001 From: Av32000 Date: Mon, 9 Jan 2023 19:19:23 +0100 Subject: [PATCH 2/2] Add Chrome Shortucuts (Update, Dino, Languages, Web Store) --- src/background.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index 79e3bb6..b99c85b 100644 --- a/src/background.js +++ b/src/background.js @@ -58,6 +58,10 @@ const clearActions = () => { { title: "Incognito mode", desc: "Open an incognito window", type: "action", action: "incognito", emoji: true, emojiChar: "๐Ÿ•ต๏ธ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'N'] }, { title: "Downloads", desc: "Browse through your downloads", type: "action", action: "downloads", emoji: true, emojiChar: "๐Ÿ“ฆ", keycheck: true, keys: ['โŒ˜', 'โ‡ง', 'J'] }, { title: "Extensions", desc: "Manage your Chrome Extensions", type: "action", action: "extensions", emoji: true, emojiChar: "๐Ÿงฉ", keycheck: false, keys: ['โŒ˜', 'D'] }, + { title: "Update", desc: "Check Google Chrome Updates", type: "action", action: "update", emoji: true, emojiChar: "๐Ÿ”„๏ธ", keycheck: false, keys: ['โŒ˜', ','] }, + { title: "Dino", desc: "Open Google Chrome dino game", type: "action", action: "dino", emoji: true, emojiChar: "๐Ÿฆ•", keycheck: false, keys: ['โŒ˜', ','] }, + { title: "Languages Settings", desc: "Open Languages Settings", type: "action", action: "languages", emoji: true, emojiChar: "๐ŸŒ", keycheck: false, keys: ['โŒ˜', ','] }, + { title: "Chrome Web Store", desc: "Open Chrome Web Store", type: "action", action: "url", emoji: true, emojiChar: "๐Ÿ›๏ธ", keycheck: false, keys: ['โŒ˜', ','], url: "https://chrome.google.com/webstore/category/extensions" }, { title: "Chrome settings", desc: "Open the Chrome settings", type: "action", action: "settings", emoji: true, emojiChar: "โš™๏ธ", keycheck: true, keys: ['โŒ˜', ','] }, { title: "Scroll to bottom", desc: "Scroll to the bottom of the page", type: "action", action: "scroll-bottom", emoji: true, emojiChar: "๐Ÿ‘‡", keycheck: true, keys: ['โŒ˜', 'โ†“'] }, { title: "Scroll to top", desc: "Scroll to the top of the page", type: "action", action: "scroll-top", emoji: true, emojiChar: "๐Ÿ‘†", keycheck: true, keys: ['โŒ˜', 'โ†‘'] }, @@ -90,7 +94,7 @@ const clearActions = () => { case "downloads": action.keys = ['Ctrl', 'J']; break; - case "settings": + case "settings" || "update" || "dino" || "languages": action.keycheck = false; break; case "history": @@ -423,6 +427,15 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { case "manage-data": openChromeUrl("settings/clearBrowserData"); break; + case "languages": + openChromeUrl("settings/languages") + break; + case "dino": + openChromeUrl("dino") + break; + case "update": + openChromeUrl("settings/help") + break; case "incognito": openIncognito(); break;