Skip to content

Commit

Permalink
Add options page with a link as an alternative way to open the tab
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Dec 27, 2017
1 parent f6c6111 commit 7a9f69c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# ChangeLog for squashmount

*bookmarkdupes-4.1.1:
*bookmarkdupes-4.2:
Martin Väth <martin at mvath.de>:
- Add an options page with a link as an alternative way to open the
extension. This is mainly meant as a workaround for
https://github.com/vaeth/bookmarkdupes/issues/38

Juan Salvador Aleixandre Talens:
- Update es locales

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ A WebExtension which can display/remove duplicate bookmarks, empty folders, or d

After installing bookmarkdupes, the usage is rather simple:

Click on bookmardupes' symbol (duplicate stars) and then
select in the new tab what you want to display:
To open bookmarkdupes, click the extension symbol (duplicate stars) or
use the link in the options page of the extension.
Then select what you want to display:

1. Bookmark duplicates (exact)
2. Bookmark duplicates (similar)
Expand Down Expand Up @@ -50,8 +51,9 @@ the corresponding bookmarks to their previous location in the bookmark menu!
https://github.com/vaeth/bookmarkdupes/issues/11 and the second part of
https://github.com/vaeth/bookmarkdupes/issues/8
4. In some firefox versions (e.g. 55.0.3) it has been reported that pressing
the duplicate stars does not open a new tab. For a discussion of this
problem and of possible workarounds, see
the duplicate stars does not open a new tab. You can try to use the link
in the options page of the extension instead if you have this problem.
The reason for the problem is still unknown, see
https://github.com/vaeth/bookmarkdupes/issues/38

## Contributions
Expand Down
11 changes: 11 additions & 0 deletions data/options/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title id="pageTitle">Bookmark Dupes</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p id="linkToTab"></p>
<script src="options.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions data/options/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Copyright (C) 2017 Nartin Väth <martin@mvath.de>
* This project is under the GNU public license 2.0
*/

function setTitle(title) {
document.getElementById("pageTitle").textContent = title;
}

function getLinkToTab() {
return document.getElementById("linkToTab");
}

function createLink(title) {
const parent = getLinkToTab();
if (parent.hasChildNodes()) { // Already done
return;
}
const link = document.createElement("A");
const url = browser.extension.getURL("data/tab/index.html")
link.href = url;
link.target = "_blank";
link.textContent = title;
link.referrerpolicy = "no-referrer";
parent.appendChild(link);
}

{
const title = browser.i18n.getMessage("extensionName");
setTitle(title);
createLink(title);
}
2 changes: 1 addition & 1 deletion data/tab/dupes.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function addBookmark(bookmark, folders, id) {
link.href = url;
link.target = "_blank";
link.textContent = name;
link.referrerpolicy = 'no-referrer';
link.referrerpolicy = "no-referrer";
col.appendChild(link);
if (id) {
col.id = id;
Expand Down
7 changes: 6 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name": "bookmarkdupes",
"description": "__MSG_extensionDescription__",
"author": "Martin Väth",
"version": "4.1.1",
"version": "4.2",
"manifest_version": 2,
"homepage_url": "https://addons.mozilla.org/en-US/firefox/addon/bookmark-dupes/",
"default_locale": "en",
Expand All @@ -25,6 +25,11 @@
}
},

"options_ui": {
"page": "data/options/index.html",
"browser_style": true
},

"icons": {
"48": "data/icons/48.png"
},
Expand Down

0 comments on commit 7a9f69c

Please sign in to comment.