ソースを参照

remove link to open the options page in a new tab when already displayed in a tab

Gildas 7 年 前
コミット
4c77d66d8b
2 ファイル変更5 行追加2 行削除
  1. 4 1
      extension/ui/bg/ui-options.js
  2. 1 1
      extension/ui/pages/options.html

+ 4 - 1
extension/ui/bg/ui-options.js

@@ -18,7 +18,7 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global browser, window, document, localStorage, FileReader */
+/* global browser, window, document, localStorage, FileReader, location */
 
 (async () => {
 
@@ -394,6 +394,9 @@
 	resetCancelButton.textContent = promptCancelButton.textContent = cancelButton.textContent = browser.i18n.getMessage("optionsCancelButton");
 	confirmButton.textContent = promptConfirmButton.textContent = browser.i18n.getMessage("optionsOKButton");
 	document.getElementById("resetConfirmLabel").textContent = browser.i18n.getMessage("optionsResetConfirm");
+	if (location.href.endsWith("#")) {
+		document.querySelector(".new-window-link").remove();
+	}
 	refresh();
 
 	async function refresh(profileName) {

+ 1 - 1
extension/ui/pages/options.html

@@ -12,7 +12,7 @@
 	<main>
 		<h3>
 			<span id="expandAllButton"></span> <span id="titleLabel"></span>
-			<a href="options.html" target="_blank"><img
+			<a href="options.html#" target="_blank" class="new-window-link"><img
 					src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg=="></a>
 			<span class="profiles">
 				<select id="profileNamesInput"></select>