Skip to content

Commit

Permalink
Merge branch 'master' of github.com:chitsaou/copy-as-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkxin committed May 27, 2018
2 parents 530ae32 + d3b04c9 commit d526c53
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/background/context-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,23 @@ function handler(info, tab) {
return promise.then(response => flashSuccessBadge(response.size))
}

let parentID = browser.contextMenus.create({
id: "parent",
title: "Copy as Markdown",
type: "normal",
contexts: ["page", "link", "image"]
});

browser.contextMenus.create({
id: "current-page",
parentId: parentID,
title: "Page [title](url)",
title: "Copy [Page Title](URL)",
type: "normal",
contexts: ["page"]
});

browser.contextMenus.create({
id: "link",
parentId: parentID,
title: "Link [text or img](url)",
title: "Copy [Link Content](URL)",
type: "normal",
contexts: ["link"]
});

browser.contextMenus.create({
id: "image",
parentId: parentID,
title: "Image ![](src)", // TODO: how to fetch alt text?
title: "Copy ![](Image URL)", // TODO: how to fetch alt text?
type: "normal",
contexts: ["image"]
});
Expand Down

0 comments on commit d526c53

Please sign in to comment.