Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cho committed Feb 4, 2023
0 parents commit 92a5af8
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,yarn

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# if you are NOT using Zero-installs, then:
# comment the following lines
!.yarn/cache

# and uncomment the following lines
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/macos,yarn
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# open-via-menlo

Browser extension that adds context menu that makes webpage links to be opened via [Menlo Security](https://safe.menlosecurity.com/).

(Only supports chrome, for now)


## Todo
- [ ] auto-redirect all links
- [ ] multi browser support
- [ ] use [chrome-types](https://www.npmjs.com/package/chrome-types)
- [ ] build workflows
14 changes: 14 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({
id: "open-via-menlo",
title: "Open via Menlo",
contexts: ["link"],
});
});

chrome.contextMenus.onClicked.addListener((info) => {
if (info.menuItemId === "open-via-menlo") {
const newUrl = `https://safe.menlosecurity.com/${info.linkUrl}`;
chrome.tabs.create({url: newUrl});
}
});
Binary file added images/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon-48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"manifest_version": 3,
"name": "Open via Menlo",
"description": "Add context menu that makes links to go via Menlo Security",
"version": "1.0",
"permissions": [
"contextMenus"
],
"icons": {
"16": "images/icon-16.png",
"48": "images/icon-48.png",
"128": "images/icon-128.png"
},
"background": {
"service_worker": "background.js"
}
}

0 comments on commit 92a5af8

Please sign in to comment.