- Create a new bookmark in your favorite browser and name it "Select All"
- Copy the code from the
bookmarklet_select_all.js
file (notsource.js
, that's just for reference) - Edit your bookmark and paste the
bookmarklet_select_all.js
code you copied into the URL field - Select ALL THE THINGS!
-
-
Save willurd/5702670 to your computer and use it in GitHub Desktop.
javascript:(function()%7Bvar style%3Ddocument.createElement("style")%3Bstyle.type%3D"text/css"%3Bstyle.innerText%3D"* %7B -webkit-user-select: all !important%3B -moz-user-select: all !important%3B user-select: all !important%3B %7D"%3Bvar head%3Ddocument.getElementsByTagName("head")%5B0%5D%3Bhead.appendChild(style)%3B%7D)()%3B |
var style = document.createElement("style"); | |
style.type = "text/css"; | |
style.innerText = "* { -webkit-user-select: all !important; -moz-user-select: all !important; user-select: all !important; }"; | |
var head = document.getElementsByTagName("head")[0]; | |
head.appendChild(style); |
Tried using the bookmarklet just now and wasn't able to select the tab title text above this comment box.
Here's a working alternative:
javascript:(function () {if (document.documentElement.contentEditable === false || document.designMode === "off") {document.body.contentEditable='true';document.designMode='on';void 0;} else if (document.documentElement.contentEditable === true || document.designMode === "on") {document.body.contentEditable='false';document.designMode='off';void 0;}})();
That will make all the content editable which gurantees text selection on every element without link interferrence.
That is a terrible alternative. Making everything content editable has many, many side effects that you aren't considering.
Instead, try just setting CSS on literally every element that needs it to allow selection:
javascript:(function() { var x = document.querySelectorAll('*'); for (var i = 0; i < x.length; i++) { if (getComputedStyle(x[i]).userSelect!=="all") {x[i].style.userSelect="all";} } })();
Tried using the bookmarklet just now and wasn't able to select the tab title text above this comment box.
Here's a working alternative:
javascript:(function () {if (document.documentElement.contentEditable === false || document.designMode === "off") {document.body.contentEditable='true';document.designMode='on';void 0;} else if (document.documentElement.contentEditable === true || document.designMode === "on") {document.body.contentEditable='false';document.designMode='off';void 0;}})();
That will make all the content editable which gurantees text selection on every element without link interferrence.