Skip to content

Instantly share code, notes, and snippets.

@Klemart3D
Created February 28, 2019 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Klemart3D/f7c8dc05a99413ba6ba9d99ad6d91de1 to your computer and use it in GitHub Desktop.
Save Klemart3D/f7c8dc05a99413ba6ba9d99ad6d91de1 to your computer and use it in GitHub Desktop.
Renamable separator bookmark for Firefox
<!doctype html>
<?php
$isHorz = (@$_GET['t'] == 'horz');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Firefox Renamable Bookmarks Separator</title>
<link rel="icon" href="<?php echo $isHorz ? 'horz' : 'vert'; ?>-favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="index.css" />
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/browser-detect/dist/browser-detect.umd.js"></script>
</head>
<body>
<div id="outer">
<div id="inner">
<div id="alert-container"></div>
I'm a <b><?php echo $isHorz ? 'horizontal' : 'vertical'; ?></b> separator.
Drag <a class="me" href="" title="Drag me!"><?php echo $isHorz ? '───────────' : ''; ?></a> to your bookmarks <em><?php echo $isHorz ? 'folders' : 'toolbar'; ?></em>.<br><br>
For a <b><?php echo $isHorz ? 'vertical' : 'horizontal'; ?></b> separator, click <a href="<?php echo $isHorz ? 'index.php' : 'index.php?t=horz'; ?>">here</a>.
<br><br><b>:)</b><br><br><br>
</div>
</div>
<script>
const detectedBrowser = browserDetect();
// Chrome 69 bug
if (detectedBrowser.name === "chrome" && detectedBrowser.versionNumber >= 69 && detectedBrowser.versionNumber < 70) {
$('#alert-container').html(`
<div class="alert alert-warning" role="alert">
Unfortunately, due to <a href="https://productforums.google.com/forum/#!topic/chrome/sHG5ntLrdwQ" target="_blank">a bug in Chrome 69</a> you can't drag the "me" button to your bookmarks toolbar.
</div>`);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment