Copies the page ID of the current Confluence page to the clipboard for later use.

The bookmarklet allows to copy the Confluence page id to the clipboard.

Bookmarklet

The bookmarklet is ready to use. Simply drag and drop the bookmarklet button to the bookmarks in your browser.

Ready to use!

Error rendering macro 'projectdoc-bookmarklet-button-macro'

org/apache/commons/lang/StringUtils

Code

The code is available on the resource repository.

copy-page-id-to-clipboard.js
function copyConfluencePageIdToClipboard () {
    var tmp = document.createElement('textarea');
    tmp.value = AJS.Meta.get('page-id');
    tmp.style = {position: 'absolute', left: '-9999px'};
    tmp.setAttribute('readonly', '');
    document.body.appendChild(tmp);
    tmp.select();
    document.execCommand('copy');
    document.body.removeChild(tmp);
}
copyConfluencePageIdToClipboard ();