[node,title,fragment] bookmarklet

• 2022年12月23日 23:57

Online doc reccomends Link to the page's node number, not the page's URL which requires clicking 'Edit' and brews typo error. This bookmarklet (wikipedia) provides a way to get the required syntax in one click:

javascript:void function(){prompt("",`[node:${drupalSettings.path.currentPath.replace("node/","")}${document.querySelector("meta[property=\"og:title\"]").content?`,title="${document.querySelector("meta[property=\"og:title\"]").content}"`:""}${window.location.hash?`,fragment="${decodeURIComponent(window.location.hash).replace("#","")}"`:""}]`)}();

(highlight and drag to bookmark toolbar)
Happy holidays


评论

您还有未解之惑吗? 请登录以发布问题。