From Wikipedia, the free encyclopedia
CopyCodeBlock
DescriptionAdds a button to copy the content of each code block (<pre>)
UpdatedJuly 28, 2023
    (8 months ago)
Browser supportChrome, Firefox, etc.
Source User:Nardog/CopyCodeBlock.js

This script adds a button at the top right corner of each code block (created in wikitext via <pre>...</pre>, <syntaxhighlight>...</syntaxhighlight>, or a line beginning with a space, or the entirety of a Lua, CSS, or JavaScript page) that only shows up when your mouse cursor is inside the block and copies the content of the block when clicked.

Installation

Add the following to your common.js or global.js:

mw.loader.load('//en.wikipedia.org/?title=User:Nardog/CopyCodeBlock.js&action=raw&ctype=text/javascript');

Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.

From Wikipedia, the free encyclopedia
CopyCodeBlock
DescriptionAdds a button to copy the content of each code block (<pre>)
UpdatedJuly 28, 2023
    (8 months ago)
Browser supportChrome, Firefox, etc.
Source User:Nardog/CopyCodeBlock.js

This script adds a button at the top right corner of each code block (created in wikitext via <pre>...</pre>, <syntaxhighlight>...</syntaxhighlight>, or a line beginning with a space, or the entirety of a Lua, CSS, or JavaScript page) that only shows up when your mouse cursor is inside the block and copies the content of the block when clicked.

Installation

Add the following to your common.js or global.js:

mw.loader.load('//en.wikipedia.org/?title=User:Nardog/CopyCodeBlock.js&action=raw&ctype=text/javascript');

Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.


Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook