Add search syntax

This commit is contained in:
syuilo
2018-04-21 18:59:16 +09:00
parent 3c80f0eaca
commit 441796f845
4 changed files with 95 additions and 0 deletions

View File

@ -75,6 +75,13 @@ const handlers = {
a.href = url;
a.textContent = url;
document.body.appendChild(a);
},
search({ document }, { content, query }) {
const a = document.createElement('a');
a.href = `https://www.google.com/?#q=${query}`;
a.textContent = content;
document.body.appendChild(a);
}
};