Chrome Extension to Easily Document References in Your Code

posted


I wrote a simple Chrome Extension to add a link to the top of every answer to a question on any Stack Exchange site (stackoverflow.com, wordpress.stackexchange.com, etc.) that you can click to automatically copy the link to that specific answer on the question’s page. I find it extremely helpful for a few reasons:

  1. There may not be an accepted answer yet
  2. The accepted answer may be downvoted in the future and replaced with a more contemporary solution
  3. The accepted answer may not actually work for your situation
  4. The specific answer you want to link to may have pointed you in the right direction to solving your problem

You can get the extension here: Chrome Extension or github.

You’ll have to manually install the github version, but it’s licensed under the MIT license so feel free to fork it and start tinkering. If you make any great modifications let us know.

I use it to generate simple comments for reference, as seen here:

<code data-language="javascript">//borrowed from http://stackoverflow.com/questions/8794633/chrome-extension-copy-text#answer-8807145  
chrome.extension.onRequest.addListener(function(obj) {  
  copy<em>to</em>clipboard(obj.link);
});
//end borrowed code
comments powered by Disqus