yorkxin / copy-as-markdown Goto Github PK
View Code? Open in Web Editor NEWCopying Link, Image and Tab(s) as Markdown Much Easier.
License: MIT License
Copying Link, Image and Tab(s) as Markdown Much Easier.
License: MIT License
i.e. Let user choose whether the link is formatted as
[Text](url)
or
[Text][id]
[id]:url
I recall that when AMO tightened its CSP a few months ago, a variety of extensions became non-applicable to AMO – washing machine, for example:
Today I was surprised by Copy as Markdown (and Link Text and Location Copier) not working at AMO. Surprised because I'm an extremely frequent user of Copy as Markdown, and I must have copied titles and URLs from AMO pages on hundreds or thousands of occasions in recent months, and I don't recall performing the copies without Copy as Markdown.
Am I going mad? (Has the extension never worked with the the increased CSP at AMO?)
I'm aware of WebExtensions APIs and so on, just surprised by the non-function today.
Using Waterfox, if that's relevant. Recently updated to 56.2.0.31 on FreeBSD-CURRENT.
So that code can be shared between Chrome and Firefox, and possibly browsers supporting WebExtensions in the future.
So it can continue work on Firefox since 2018: https://blog.mozilla.org/addons/2016/11/23/add-ons-in-2017/
https://wiki.mozilla.org/WebExtensions
Problems:
web-extension
branch, with Webpack. Looks good.It would be nice to close the popup automatically after a short timeout to avoid the unnecessary extra click.
The current "copied!" message could be replaced by highlighting the button.
I use this extension dozen times a day. I saw in README that keybinding/shortcut only works in chrome.
Can we hope adding shortcut support for Firefox ?
Many keyboard binding extension stop working for Quantum. But I find saka works in Quantum. So I think there is still a hope :).
Would it be possible to make this work with bookmarks? For example, I'd like to copy an existing FF link in my bookmark toolbar as Markdown link?
Copying the title of https://www.youtube.com/watch?v=SNE2oCZH_4k page results into string like this:
[M.O.O.N. - 'Hydrogen' [Hotline Miami Soundtrack] - YouTube](https://www.youtube.com/watch?v=SNE2oCZH_4k)
Notice the unescaped angle brackets. Pasting that to, e.g., stackoverflow.com chat results into a broken link/Markdown. The angle brackets should be escaped by backslash.
Current Tab in particular would be great. All Tabs (n) would be great too.
I think this is new with Version: 1.1.0, Updated: January 11, 2016. When you use it on a page with underscores or brackets (probably other chars), the backslash appears in the title when it shouldn't, e.g. a page with the title [a_b]
is being copied as [\[a\_b\]](http://example.com)
Thanks for this extension! It's fantastic.
I just discovered that Chrome has disabled the extension because it now requires additional permissions. I can't tell what permissions are new but Chrome states:
It can now:
- Read your browsing history
- Modify data you copy and paste
Which of the permissions is new? Why is the new permission needed? Why is the 'browsing history' permission needed?
I'm assuming the 'copy and paste' permission is just allowing the extension to change the contents of the clipboard/pasteboard – is that correct?
Hi
I love this extension and use it routinely. I noticed that it is marked as a "Legacy" extension for Firefox. Do you have plans to update it to be more compatible with newer Firefox versions?
This is a follow up to #65 (comment) because I couldn't re-open that issue.
Per #65
Per #65
Per #65
Per #65
I am happy user of copy-as-org-mode. But since I can't use it in Quantum. I use copy-as-markdown to my org-mode buffer than invoke my function to transform the link to org-mode.
But, I can have title.
When I use copy-as-org-mode, I often copy link in SO questions ( I can have the title, even I copy the link of the question) . But with copy-as-markdown, I get no-title
.
e.g
I get
[(No Title)](https://emacs.stackexchange.com/questions/33380/cant-set-default-servers-in-erc-layer)
Expected output
[Can't set default servers in ERC layer](https://emacs.stackexchange.com/questions/33380/cant-set-default-servers-in-erc-layer)
Firefox 58.0.2
Debian 9.2
From Chrome version ?? it allows context menu being inserted into the dropdown menu of browser action (badge).
https://developer.chrome.com/extensions/contextMenus#type-ContextType
Seems good. Let me do this.
The dropdown menu is all black and illegible when used with a KDFE/Firefox dark theme.
This feature requires ui/button/toggle API, available from Firefox 30.
First of all: thank you for your work! 👍
I found your extension because I was looking for a way to convert content from a web page to markdown.
Now I saw that this isn't fully possible yet but it would be really, really nice.
I'm basically looking for the functionality given in http://heckyesmarkdown.com.
Bonus: ideally with the possibility to select content that should be converted and converting to inline images.
Thank you in advance and I hope you have a nice day!
Event page will become inactive, causing Popup and Command (keyboard shortcut) not working.
http://developer.chrome.com/extensions/event_pages.html
It's available on M22.
When the page action popup is displayed, automatically copy "link for current tab".
It looks like issue #50 has returned. What gives?
In FF Quantum (FF 57.0), when I entered reader mode for a page, the menu items are there, but don't actually change the clipboard.
support for short-link on the head
:
<link rel='shortlink' href='...' />
It works just the last update. Firefox 36.0.1 on Ubuntu amd64 14.04LTS
(Same issue in yorkxin/git-io-shortener#5)
chrome.tabs.getSelected()
is deprecated since Chrome 16. It might be removed sooner or later.
The methods getAllInWindow() and getSelected() have been deprecated. To get details about all tabs in the specified window, use chrome.tabs.query() with the argument {'windowId': windowID}. To get the tab that is selected in the specified window, use chrome.tabs.query() with the argument {'active': true}.
So we should use chrome.tabs.query({active: true}, function() {...} );
http://code.google.com/chrome/extensions/tabs.html#method-query
See #34
In some rare cases the Markdown code should be escaped, but mostly it is not necessary.
Before we figure out how to handle this smartly, let's make it an option in Extensions page.
Hi, thank you for the extension, it already covers 90% of the use cases that I have. There's one feature that would cover the remaining 10%.
What Copy As Markdown currently lets you do is to copy the tab URL with the tab title as a markdown link.
What I'd also like to be able to do:
Do you think it would be useful to allow copying a block of the webpage text to markdown?
Currently the list style used to export links is hardcoded to asterisks. I'd love to see an option to change the style:
Clipboard.writeText is an API specifically for writing to the clipboard. It would avoid the need to create an invisible textarea and exec a copy command on it, and in Firefox would avoid the need for a content-script (as background scripts can use that API)
I would like to be able to right click and copy a bookmark from the bookmarks menu as markdown.
The Firefox extension appears to be absent from addons.mozilla.org
.
Personally I use this extension a lot for aggregating pull requests.
When copying with GitHub issues, we get string like this:
* [Web extension by chitsaou · Pull Request #48 · chitsaou/copy-as-markdown](https://github.com/chitsaou/copy-as-markdown/pull/48)
result is:
For GitHub, instead of links, we can also copy title only -- GitHub will handle link referencing automatically:
* Web extension by chitsaou · Pull Request #48 · chitsaou/copy-as-markdown
becomes
But the string itself can be reformatted to make it look better:
* #48 Web extension by @chitsaou
becomes
Add a setting to let user customize title style per domain.
Make it per site because usually the title are same under the same domain.
For example:
/(.+) by ([\S]+) · Pull Request (#\d+) · (.+)
replaces to
$3 $1 by @$2 ($4)
Furthermore, it should be able to be imported, so users can "install a plugin" for common sites.
According to http://code.google.com/chrome/extensions/manifestVersion.html:
Starting from Chrome 23 (Beta: Late September 2012; Stable: Early November 2012)
M23 has been landed to Canary. Time to refactor the code.
As allenlinli recommended, it would be good to let user specify a keyboard shortcut to copy the markdown code of current page.
As of Chrome 22, in the Extensions page, user can configure keyboard shortcuts for commands of Extensions. So I think the only thing to implement is to let Chrome know there is such a command that can be bounded with a keyboard shortcut.
Currently it only supports "convert all tabs to markdown."
It would be great if user can select which tabs he want to convert to list of links in Markdown, by highlighting specific tabs (command-click on Mac, or control-click on Windows).
Is it possible to do this through chrome.tabs.query()
?
Thanks for this brilliant extension, it saves me a lot of time.
But I usually need to copy multi links at the same time, for example, I want to copy this project's title.
The html code is like this:
<a href="/chitsaou">chitsaou</a> / <a href="/chitsaou/copy-as-markdown">copy-as-markdown</a>
Is it possible to copy this as:
[chitsaou](https://github.com/chitsaou) / [copy-as-markdown](https://github.com/chitsaou/copy-as-markdown)
Go a step further, is there any way to copy selected block to markdown directly?
Sincerely.
Hey, I am trying to find an alternative to CoLT since that seems abandoned and I have found you addon.
Would it be possible to implement identical functionality? Like copying just the link text and even better if it can be an option on the main right click. (for example with CoLT I can right click and select Copy Link Text right away or even faster right click and press "x" on the keyboard because the developer added that shortcut)
Thanks
And it should generate the link in Markdown format automatically.
What an awesome extension! I use it via a context menu and this is what I see 99% of the time as I'm generally interested only in full page titles:
This means that I need to hover over the top-level menu item, move my cursor to the right and select the single option. Would it be possible to somehow make the top-level item do the copy already if there's just a single nested item?
I realize that there are situations where there are more nested items, in which case they would stay. For example:
Hello,
Thanks for your plugin which helps to spend less time when writing in Markdown. I tried it and it works well with normal windows.
However, I often use the private windows in Firefox and the "Copy as markdown" action doesn't show on right click. It appears only in normal windows.
Could you make your plugin also available in private windows?
I'm using Firefox 47.0.1 on Linux.
Hi,
I'd like to copy articles and automatically include links as markdown (italics, bolds, etc. would be nice as well).
I can implement the logic myself, but could you point me in the right direction? Which files would I need to edit to create a button on right click, where do I need to put my logic and so on.
Thanks
Right click context menu not available in latest version of Chrome
Right-click context menu is shown
Right-click context menu not available in menu
Windows XP
Chrome 17
Reason: there is no info.selectionText
because it does not select the text when right-clicking on a link.
Used to work. Upgraded today and now they don't. Clicking the buttons themselves still works. I was wrong, the buttons don't work either :/
EDIT: It seems that the buttons work until you set up a keyboard shortcut and try to use it, then the keyboard shortcut does nothing and the buttons also cease to do anything. Uninstalling and reinstalling the extension gets you back to square one, but adding shortcuts again causes it to get stuck.
Firefox version is now implemented on firefox
branch under src-fx
directory.
Features:
[x] Copy all tabs of current window as a Markdown list.
[x] Right click on anywhere of a page and copy the page title with URL as Markdown.
[x] Right click on a link and copy it as Markdown.
[x] Right click on an image and copy it as Markdown.
[ ] When copying an Image, if it is wrapped by a link, then the copied Markdown should also include that link.
[ ] Context Menu Icon.
[ ] Dynamic context menu item titles.
[ ] A dropdown menu when clicking the Copy as Markdown browser button, like Chrome version. (Requires ui/button/toggle API, available from Firefox 30)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.