Skip to content

Instantly share code, notes, and snippets.

@miguel-leon
Created November 21, 2023 07:19
Show Gist options
  • Save miguel-leon/22ef268abed377d3eb3240e30812cefe to your computer and use it in GitHub Desktop.
Save miguel-leon/22ef268abed377d3eb3240e30812cefe to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
</style>
</head>
<body>
<script>
const search = location.search.replace(/^\?/, '');
if (search) {
const content = decodeURIComponent(search);
navigator.clipboard.writeText(content)
.then(() => {
console.log('%cCopied:', 'color:gold', content);
history.back();
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment