Bookmarklet maker is a small web app to create bookmarklet or small executable Javascript apps to peform browser automation tasks.
You can run this app by accessing the hyperlink:
If you don’t know what is a bookmarklet, see:
<title>Paget Title</title>document.title<meta content="author M.r dummy" name="author">Array.from(document.getElementsByTagName("meta"))
.find(function(e){return e.name == "author"})
.content<meta content="A description of the page." name="description">Array.from(document.getElementsByTagName("meta"))
.find(function(e){return e.name == "description"})
.content<meta content="keyword1 keyword2 keyword2" name="keywords">Array.from(document.getElementsByTagName("meta"))
.find(function(e){return e.name == "keywords"})
.content> var d = new Date() ; (d.getYear() + 1900).toString() + "-" + d.getMonth().toString() + "-" + d.getDay().toString()
"2016-9-4"Function getDate()
function getDate(){
var d = new Date();
return (d.getYear() + 1900).toString() + "-" +
d.getMonth().toString() + "-" + d.getDay().toString() ;
}
>> getDate()
"2017-3-5"document.URLwindow.location.href = "http://www.httpbin.org/get"window.open("http://www.mdn.org")URL Manipulation is useful to send the current URL to some web service or Web App such as Google Drive or Web Archive.
- Open some page that doesn’t exist anymore in Web Archive:
var baseUrl = "https://web.archive.org/web/*/"
var urlmod = document.URL
window.location.href = baseUrl + urlmodalert("My message");- The promopt function is useful to read user input and allow user to copy some data.
prompt("Window title", "Content")console.log(object);
console.log("My message");function getDate(){
var d = new Date()
return (d.getYear() + 1900).toString() + "-" +
d.getMonth().toString() + "-" + d.getDay().toString() ;
};
var text = '*' + document.title + '*' + " Accessed at " + getDate() +
". Available at <" + document.URL + "> " ;
prompt("Type Ctrl+A and Ctrl+C to copy the markdown", text);It will generate a reference like this:
- Overview of Forks, Threads, and Asynchronous I/O Accessed at 2017-3-5. Available at http://www.remwebdevelopment.com/blog/overview-of-forks-threads-and-asynchronous-io-133.html
- *Overview of Forks, Threads, and Asynchronous I/O* Accessed at 2017-3-5. Available at <http://www.remwebdevelopment.com/blog/overview-of-forks-threads-and-asynchronous-io-133.html>
This will set the page width to the width of an A4 ISO paper sheet that makes easier to read long texts in the browser.
document.querySelector("body").style.setProperty("width", "800px")document.querySelector("body").style.setProperty("color", "white")
document.querySelector("body").style.setProperty("background", "black")document.querySelector("body").style.setProperty("background", "white")