Skip to content

Commit 329c5e3

Browse files
committed
Add rel='noopener noreferrer' to external links to prevent referrer leakage. Fix #33
1 parent 07ace93 commit 329c5e3

File tree

9 files changed

+44
-20
lines changed

9 files changed

+44
-20
lines changed

locales/de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@
202202
"findersUrlFormat": "URL-Format: Verwende <code>%s</code> in der URL, wo du den Suchbegriff einfügen möchtest, oder lasse ihn weg, um den Suchbegriff an das Ende der URL anzuhängen. Beispiele: <code>https://google.com/search?q=%s</code>, <code>https://youtube.com/search?q=%s</code>, <code>https://github.com/search?q=%s</code>, <code>https://store.steampowered.com/search?term=%s</code>.",
203203
"dataStorage": "Datenspeicherung: Alle Daten liegen im Verzeichnis <code>/data</code>. Dazu gehören Einstellungen, Seiten, Farben, Favicons, Fonts und Lesezeichen-Dateien.",
204204
"deviceSpecificSettings": "Gerätespezifische Einstellungen: Wenn aktiviert, werden deine Einstellungen lokal im Browser gespeichert und nicht zwischen Geräten synchronisiert.",
205-
"feedback": "Fehler gefunden oder Feedback? Besuche das <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub-Repository</code></a>.",
205+
"feedback": "Fehler gefunden oder Feedback? Besuche das <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub-Repository</code></a>.",
206206
"chromeExtension": "Chrome-Erweiterung",
207207
"extensionIntro": "ThinkDashboard bietet eine Chrome-Erweiterung zum schnellen Hinzufügen von Lesezeichen direkt aus Webseiten.",
208-
"extensionInstall": "Installation: Klone das <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub-Repository</code></a> oder lade die ZIP-Version herunter. Öffne <code>chrome://extensions/</code>, aktiviere „Entwicklermodus“ und lade den Ordner <code>extension</code>.",
208+
"extensionInstall": "Installation: Klone das <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub-Repository</code></a> oder lade die ZIP-Version herunter. Öffne <code>chrome://extensions/</code>, aktiviere „Entwicklermodus“ und lade den Ordner <code>extension</code>.",
209209
"extensionConfig": "Konfiguration: Öffne die Erweiterung, gehe in die Einstellungen und gib die ThinkDashboard-URL sowie Standardseite und Kategorie an.",
210210
"extensionUsage": "Verwendung: Klicke auf das Symbol, passe bei Bedarf Name, URL, Seite oder Kategorie an und speichere das Lesezeichen."
211211
},

locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@
202202
"findersUrlFormat": "URL Format: Use <code>%s</code> in the URL where you want the search term to be inserted, or leave it out to append the search term to the end of the URL. Examples: <code>https://google.com/search?q=%s</code>, <code>https://youtube.com/search?q=%s</code>, <code>https://github.com/search?q=%s</code>, <code>https://store.steampowered.com/search?term=%s</code>.",
203203
"dataStorage": "Data Storage: All app data is saved in the <code>/data</code> directory. This includes JSON files for settings (your dashboard settings), pages (pages order), and colors (custom themes), as well as uploaded favicon, fonts, and individual bookmark pages (bookmarks-1.json, bookmarks-2.json, etc.).",
204204
"deviceSpecificSettings": "Device-Specific Settings: When enabled, your dashboard settings are saved locally in your browser instead of on the server. This means settings are specific to this device/browser and won't sync across different devices.",
205-
"feedback": "Found a bug or have feedback? Visit the <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub repository</code></a> to report issues or suggest improvements.",
205+
"feedback": "Found a bug or have feedback? Visit the <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub repository</code></a> to report issues or suggest improvements.",
206206
"chromeExtension": "Chrome Extension",
207207
"extensionIntro": "ThinkDashboard includes a Chrome extension that allows you to quickly add bookmarks from any webpage directly to your dashboard.",
208-
"extensionInstall": "To install the extension: Clone the <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub repository</code></a> to your local machine, or download the latest version from <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\"><code>here</code></a>. Then go to Chrome's extension settings (chrome://extensions/), enable \"Developer mode\", and click \"Load unpacked\". Select the <code>extension</code> folder from the downloaded or cloned repository.",
208+
"extensionInstall": "To install the extension: Clone the <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub repository</code></a> to your local machine, or download the latest version from <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><code>here</code></a>. Then go to Chrome's extension settings (chrome://extensions/), enable \"Developer mode\", and click \"Load unpacked\". Select the <code>extension</code> folder from the downloaded or cloned repository.",
209209
"extensionConfig": "Configuration: Once installed, open the extension and go to the Settings tab. Enter your ThinkDashboard URL, set the Default Page where bookmarks will be saved, and choose the category within that page.",
210210
"extensionUsage": "Usage: Click the extension icon, optionally modify the name, URL, page, and category, then click Save Bookmark."
211211
},

locales/es.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@
202202
"findersUrlFormat": "Formato de URL: Usa <code>%s</code> en la URL donde quieres que se inserte el término de búsqueda, o déjalo fuera para agregar el término de búsqueda al final de la URL. Ejemplos: <code>https://google.com/search?q=%s</code>, <code>https://youtube.com/search?q=%s</code>, <code>https://github.com/search?q=%s</code>, <code>https://store.steampowered.com/search?term=%s</code>.",
203203
"dataStorage": "Almacenamiento de Datos: Todos los datos de la app se guardan en el directorio <code>/data</code>. Esto incluye archivos JSON para settings (tus configuraciones del dashboard), pages (orden de páginas), y colors (temas personalizados), así como favicon subidos, fuentes, y páginas individuales de marcadores (bookmarks-1.json, bookmarks-2.json, etc.).",
204204
"deviceSpecificSettings": "Configuraciones Específicas del Dispositivo: Cuando está habilitado, tus configuraciones del dashboard se guardan localmente en tu navegador en lugar del servidor. Esto significa que las configuraciones son específicas para este dispositivo/navegador y no se sincronizarán entre diferentes dispositivos.",
205-
"feedback": "¿Encontraste un bug o tienes comentarios? Visita el <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>repositorio de GitHub</code></a> para reportar problemas o sugerir mejoras.",
205+
"feedback": "¿Encontraste un bug o tienes comentarios? Visita el <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>repositorio de GitHub</code></a> para reportar problemas o sugerir mejoras.",
206206
"chromeExtension": "Extensión de Chrome",
207207
"extensionIntro": "ThinkDashboard incluye una extensión de Chrome que te permite agregar rápidamente marcadores desde cualquier página web directamente a tu dashboard.",
208-
"extensionInstall": "Para instalar la extensión: Clona el <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>repositorio de GitHub</code></a> en tu máquina local, o descarga la última versión desde <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\"><code>aquí</code></a>. Luego ve a la configuración de extensiones de Chrome (chrome://extensions/), habilita \"Modo desarrollador\", y haz clic en \"Cargar desempaquetada\". Selecciona la carpeta <code>extension</code> del repositorio clonado o descargado.",
208+
"extensionInstall": "Para instalar la extensión: Clona el <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>repositorio de GitHub</code></a> en tu máquina local, o descarga la última versión desde <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><code>aquí</code></a>. Luego ve a la configuración de extensiones de Chrome (chrome://extensions/), habilita \"Modo desarrollador\", y haz clic en \"Cargar desempaquetada\". Selecciona la carpeta <code>extension</code> del repositorio clonado o descargado.",
209209
"extensionConfig": "Configuración: Una vez instalada, abre la extensión y ve a la pestaña de Settings. Ingresa tu URL de ThinkDashboard, configura la Default Page donde se guardarán los marcadores, y elige la categoría dentro de esa página.",
210210
"extensionUsage": "Uso: Haz clic en el ícono de la extensión, modifica opcionalmente el nombre, URL, página y categoría, luego haz clic en Save Bookmark."
211211
},

locales/jp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@
202202
"commands": "コマンド: <code>:</code> に続けてコマンドを入力してアプリを制御します。利用可能なコマンドには <code>theme</code> (テーマ切り替え)、<code>columns</code> (列変更)、<code>fontsize</code> (フォントサイズ変更) などがあります。さらに追加予定です。",
203203
"dataStorage": "データストレージ: すべてのアプリデータは <code>/data</code> ディレクトリに保存されます。これには settings (ダッシュボード設定)、pages (ページ順序)、colors (カスタムテーマ) の JSON ファイル、アップロードされた favicon、フォント、個別のブックマークページ (bookmarks-1.json、bookmarks-2.json など) が含まれます。",
204204
"deviceSpecificSettings": "デバイス固有設定: 有効にすると、ダッシュボード設定はサーバーではなくブラウザにローカルに保存されます。つまり、設定はこのデバイス/ブラウザに固有であり、異なるデバイス間で同期されません。",
205-
"feedback": "バグを見つけたか、フィードバックがありますか? <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub リポジトリ</code></a> にアクセスして問題を報告したり改善を提案したりしてください。",
205+
"feedback": "バグを見つけたか、フィードバックがありますか? <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub リポジトリ</code></a> にアクセスして問題を報告したり改善を提案したりしてください。",
206206
"chromeExtension": "Chrome 拡張機能",
207207
"extensionIntro": "ThinkDashboard には、任意のウェブページからダッシュボードに直接ブックマークを素早く追加できる Chrome 拡張機能が含まれています。",
208-
"extensionInstall": "拡張機能をインストールするには: <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>GitHub リポジトリ</code></a> をローカルマシンにクローンするか、最新バージョンを <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\"><code>ここ</code></a> からダウンロードします。次に、Chrome の拡張機能設定 (chrome://extensions/) に移動し、「開発者モード」を有効にして、「パッケージ化されていない拡張機能を読み込む」をクリックします。クローンまたはダウンロードしたリポジトリから <code>extension</code> フォルダを選択します。",
208+
"extensionInstall": "拡張機能をインストールするには: <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>GitHub リポジトリ</code></a> をローカルマシンにクローンするか、最新バージョンを <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><code>ここ</code></a> からダウンロードします。次に、Chrome の拡張機能設定 (chrome://extensions/) に移動し、「開発者モード」を有効にして、「パッケージ化されていない拡張機能を読み込む」をクリックします。クローンまたはダウンロードしたリポジトリから <code>extension</code> フォルダを選択します。",
209209
"extensionConfig": "設定: インストール後、拡張機能を開き、Settings タブに移動します。ThinkDashboard の URL を入力し、ブックマークが保存される Default Page を設定し、そのページ内のカテゴリを選択します。",
210210
"extensionUsage": "使用方法: 拡張機能アイコンをクリックし、オプションで名前、URL、ページ、カテゴリを変更してから、Save Bookmark をクリックします。"
211211
},

locales/pl.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@
202202
"commands": "Polecenia: Wpisz <code>:</code> a następnie polecenie aby kontrolować aplikację. Dostępne polecenia obejmują <code>theme</code> (przełącz motyw), <code>columns</code> (zmień kolumny), <code>fontsize</code> (zmień rozmiar czcionki), i więcej w przyszłości.",
203203
"dataStorage": "Przechowywanie danych: Wszystkie dane aplikacji są zapisane w katalogu <code>/data</code>. Obejmuje to pliki JSON dla settings (ustawienia pulpitu), pages (kolejność stron), i colors (niestandardowe motywy), jak również przesłane favicon, czcionki, i indywidualne strony zakładek (bookmarks-1.json, bookmarks-2.json, itp.).",
204204
"deviceSpecificSettings": "Ustawienia specyficzne dla urządzenia: Po włączeniu, ustawienia pulpitu są zapisane lokalnie w przeglądarce zamiast na serwerze. Oznacza to, że ustawienia są specyficzne dla tego urządzenia/przeglądarki i nie będą synchronizowane między różnymi urządzeniami.",
205-
"feedback": "Znalazłeś błąd lub masz opinię? Odwiedź nasze <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>repozytorium GitHub</code></a> aby zgłosić problemy lub zasugerować ulepszenia.",
205+
"feedback": "Znalazłeś błąd lub masz opinię? Odwiedź nasze <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>repozytorium GitHub</code></a> aby zgłosić problemy lub zasugerować ulepszenia.",
206206
"chromeExtension": "Rozszerzenie Chrome",
207207
"extensionIntro": "ThinkDashboard zawiera rozszerzenie Chrome, które pozwala szybko dodawać zakładki z dowolnej strony internetowej bezpośrednio do pulpitu.",
208-
"extensionInstall": "Aby zainstalować rozszerzenie: Sklonuj <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\"><code>repozytorium GitHub</code></a> na swój lokalny komputer lub pobierz najnowszą wersję z <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\"><code>tutaj</code></a>. Następnie przejdź do ustawień rozszerzeń Chrome (chrome://extensions/), włącz \"Tryb programisty\", i kliknij \"Załaduj rozpakowane\". Wybierz folder <code>extension</code> ze sklonowanego lub pobranego repozytorium.",
208+
"extensionInstall": "Aby zainstalować rozszerzenie: Sklonuj <a href=\"https://github.com/MatiasDesuu/ThinkDashboard\" target=\"_blank\" rel=\"noopener noreferrer\"><code>repozytorium GitHub</code></a> na swój lokalny komputer lub pobierz najnowszą wersję z <a href=\"https://github.com/MatiasDesuu/ThinkDashboard/archive/refs/heads/main.zip\" target=\"_blank\" rel=\"noopener noreferrer\"><code>tutaj</code></a>. Następnie przejdź do ustawień rozszerzeń Chrome (chrome://extensions/), włącz \"Tryb programisty\", i kliknij \"Załaduj rozpakowane\". Wybierz folder <code>extension</code> ze sklonowanego lub pobranego repozytorium.",
209209
"extensionConfig": "Konfiguracja: Po zainstalowaniu, otwórz rozszerzenie i przejdź do zakładki Settings. Wprowadź swój URL ThinkDashboard, ustaw Default Page, gdzie będą zapisywane zakładki, i wybierz kategorię w tej stronie.",
210210
"extensionUsage": "Użycie: Kliknij ikonę rozszerzenia, opcjonalnie zmień nazwę, URL, stronę i kategorię, następnie kliknij Save Bookmark."
211211
},

static/js/hypr-mode.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ class HyprMode {
4646
return false; // Let normal behavior handle it
4747
}
4848

49-
// Open the URL in a new tab
50-
window.open(url, '_blank', 'noopener,noreferrer');
49+
// Create a link element to open the URL with rel attributes to prevent Referer leakage
50+
const link = document.createElement('a');
51+
link.href = url;
52+
link.target = '_blank';
53+
link.rel = 'noopener noreferrer';
54+
link.style.display = 'none'; // Hide the link
55+
document.body.appendChild(link);
56+
link.click();
57+
document.body.removeChild(link);
5158

5259
// Try multiple strategies to close the window
5360
setTimeout(() => {

static/js/search-finders.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,19 @@ class SearchFindersComponent {
118118
url += encodeURIComponent(processedText);
119119
}
120120

121-
// Open in new tab if setting is enabled, otherwise same tab
121+
// Create a link element to open the URL with rel attributes to prevent Referer leakage
122+
const link = document.createElement('a');
123+
link.href = url;
124+
link.style.display = 'none'; // Hide the link
122125
if (this.settings.openInNewTab) {
123-
window.open(url, '_blank');
126+
link.target = '_blank';
127+
link.rel = 'noopener noreferrer';
124128
} else {
125-
window.location.href = url;
129+
link.rel = 'noreferrer';
126130
}
131+
document.body.appendChild(link);
132+
link.click();
133+
document.body.removeChild(link);
127134
}
128135
}
129136

static/js/search.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,20 @@ class SearchComponent {
716716
// Check if HyprMode is enabled
717717
if (window.hyprMode && window.hyprMode.isEnabled()) {
718718
window.hyprMode.handleBookmarkClick(bookmark.url);
719-
} else if (this.settings.openInNewTab) {
720-
window.open(bookmark.url, '_blank', 'noopener,noreferrer');
721719
} else {
722-
window.location.href = bookmark.url;
720+
// Create a link element to open the URL with rel attributes to prevent Referer leakage
721+
const link = document.createElement('a');
722+
link.href = bookmark.url;
723+
link.style.display = 'none'; // Hide the link
724+
if (this.settings.openInNewTab) {
725+
link.target = '_blank';
726+
link.rel = 'noopener noreferrer';
727+
} else {
728+
link.rel = 'noreferrer';
729+
}
730+
document.body.appendChild(link);
731+
link.click();
732+
document.body.removeChild(link);
723733
}
724734
}, 100);
725735
}

0 commit comments

Comments
 (0)