Skip to content

Instantly share code, notes, and snippets.

@scottoffen
Created July 2, 2014 21:25
Show Gist options
  • Select an option

  • Save scottoffen/ac8cc4753b91096da4b2 to your computer and use it in GitHub Desktop.

Select an option

Save scottoffen/ac8cc4753b91096da4b2 to your computer and use it in GitHub Desktop.
HTML page to make links to resources you want to download with a right click
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Save URL Contents</title>
<style type="text/css">
body
{
margin: 0px;
padding: 0px;
color: #2b2b2b;
background-color: #f2f2f2;
font-family: 'Calibri';
font-size: 10pt;
}
#header
{
position: absolute;
top: 0px;
left: 0px;
right: 0px;
height: 60px;
background-color: #2b2b2b;
color: #f2f2f2;
}
#header h1
{
margin: 0px;
font-family: 'Calibri';
font-size: 16pt;
padding: 20px 20px 20px 20px;
}
#content
{
position: absolute;
top: 60px;
left: 0px;
right: 0px;
}
#content .inner
{
padding: 20px 20px 20px 20px;
}
#content input[type="text"]
{
width: 200px;
}
#content button
{
font-size: 9pt;
}
#content h2
{
margin: 0px;
font-family: 'Calibri';
font-size: 12pt;
padding: 20px 0px 10px 0px;
}
#results a
{
display: block;
}
</style>
<script>
window.onload = function ()
{
var url = document.getElementById('URL');
var div = document.getElementById('results');
url.value = "";
div.innerHTML = "";
};
function Generate ()
{
var url = document.getElementById('URL');
var div = document.getElementById('results');
var a = document.createElement('a');
a.setAttribute('href', url.value);
a.innerHTML = url.value;
div.appendChild(a);
url.value = "";
url.focus();
}
</script>
</head>
<body>
<div id="header">
<h1>Save URL Contents</h1>
</div>
<div id="content">
<div class="inner">
URL : <input type="text" name="URL" id="URL"> <button onclick="Generate();">Generate</button><br>
<h2>Links:</h2>
<div id="results"></div>
</div>
</div>
</body>
</html>
@scottoffen

Copy link
Copy Markdown
Author

Great for when you want to download something that may not be visible on a webpage (js, css, etc) via the browsers right-click menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment