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.
Bookmarklets editor
The Bookmarklets Extension contains a doctype that provides a bookmarklets editor to edit and create bookmarklets.
Code
The code is available on the resource repository.
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 ();
Work-in-progress
Note that the bookmarklets we present on this page are work-in-progress.
Currently we even refer to the master branch of the bookmark's JavaScript code. This will change in future once we have proper releases for our bookmarks project.
While we use the code in our daily work, your use case may be different. Therefore please check the code and maybe fork the projectdoc Bookmarklets Project to adjust the code according to your requirements.