Skip to content

Instantly share code, notes, and snippets.

@turusuke
Last active December 25, 2017 08:04
Show Gist options
  • Save turusuke/2302df4ebad26d0824df069ef8816fc2 to your computer and use it in GitHub Desktop.
Save turusuke/2302df4ebad26d0824df069ef8816fc2 to your computer and use it in GitHub Desktop.
今見ているページをチャットワークで共有
javascript:(function()%7B(()%20%3D%3E%20%7Bconst%20title%20%3D%20encodeURIComponent(document.title)%3Bconst%20url%20%3D%20encodeURIComponent(window.location)%3Bconst%20w%20%3D%20600%3Bconst%20h%20%3D%20500%3Bconst%20popup%20%3D%20%60https%3A%2F%2Fwww.chatwork.com%2Fpackages%2Fshare%2Flogin.php%3Furl%3D%24%7Burl%7D%26title%3D%24%7Btitle%7D%60%3Bconst%20l%20%3D%20screen.width%20%2F%202%20-%20w%20%2F%202%3Bconst%20t%20%3D%20screen.height%20%2F%202%20-%20h%20%2F%202%3Bwindow.open(popup%2C%20%22ChatWorkShare%22%2C%20%60resizable%2Cscrollbars%2Cstatus%2Cwidth%3D%24%7Bw%7D%2C%20height%3D%24%7Bh%7D%2Cleft%3D%24%7Bl%7D%2Ctop%3D%24%7Bt%7D%60)%3B%7D)()%7D)()
(() => {
const title = encodeURIComponent(document.title);
const url = encodeURIComponent(window.location);
const w = 600;
const h = 500;
const popup = "https://www.chatwork.com/packages/share/login.php?url=" + url + "&title=" + title;
const l = screen.width / 2 - w / 2;
const t = screen.height / 2 - h / 2;
window.open(popup, "ChatWorkShare", "resizable,scrollbars,status,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment