Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Release Next Major Version v2.0.0 #267

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f22abca
Implement new status 'connecting', automatic reconnect on disconnect …
schlagmichdoch Feb 4, 2024
d81c03a
Prefill room secrets entry with displayName given by server to preven…
schlagmichdoch Feb 4, 2024
a5dc8b6
Split transfer into message and data transfer and rewrite FileChunker…
schlagmichdoch Feb 5, 2024
c37412c
Fix variable should be static
schlagmichdoch Feb 5, 2024
1d81b74
Put blop sound into separate function and only play if on desktop
schlagmichdoch Feb 5, 2024
e5a09b6
Include label in x-peer size transformation; Prevent use of transpare…
schlagmichdoch Feb 5, 2024
c670b39
Fix byte size conversion
schlagmichdoch Oct 12, 2023
91fc2b7
Add speed log to browser console
schlagmichdoch Oct 13, 2023
cfe5b4a
Prevent full datachannel buffer on file end
schlagmichdoch Feb 5, 2024
b61de4e
send transfer abortion in some cases; Clarify variable names
schlagmichdoch Feb 5, 2024
6de97e7
Put all log prompts into new Logger class; Only log debugging logs to…
schlagmichdoch Feb 5, 2024
8873910
Remove limit for sending to iOS devices (fixes #211)
schlagmichdoch Feb 5, 2024
7af51bb
Tidy up chunker code
schlagmichdoch Feb 5, 2024
417d542
Refactor _displayFiles function; Only show ReceiveFileDialog if share…
schlagmichdoch Feb 5, 2024
3dd40e2
Refactor _downloadNotification function
schlagmichdoch Feb 5, 2024
1d62a9f
Add state management to network peers
schlagmichdoch Feb 6, 2024
c33d497
Animate progress circle and show complete status in blue for 10s
schlagmichdoch Feb 6, 2024
6d95f3f
Fix canceling file selector on Windows Edge sometimes blocks UI (#257)
schlagmichdoch Feb 6, 2024
ef3c338
Activate NoSleep on file transfers instead of on click and deactivate…
schlagmichdoch Feb 6, 2024
5ee8bb8
Move file creation to serviceworker to prevent loading everything int…
schlagmichdoch Feb 7, 2024
40a12b5
Fix progress animation
schlagmichdoch Feb 7, 2024
2d2cfec
Add missing checks for transfer states
schlagmichdoch Feb 7, 2024
d8908e0
Add alert for iOS when receiving big files using a private tab
schlagmichdoch Feb 7, 2024
19d33e1
Implement fallback to download if navigator.share() fails. Refactor R…
schlagmichdoch Feb 8, 2024
902b5c6
Refactor file transfer
schlagmichdoch Feb 8, 2024
7c6062e
Solve "transfer-complete" and "receive-complete" status detection via…
schlagmichdoch Feb 9, 2024
65936a4
Truncate file used by the sw-file-digester.js after processing
schlagmichdoch Feb 9, 2024
1df8fe2
Tidy up zipper functions
schlagmichdoch Feb 13, 2024
da558dd
Move beforeunload event to Peer class to include it to the WSPeer; Ad…
schlagmichdoch Feb 13, 2024
7c47191
Tidy up Peer classes
schlagmichdoch Feb 13, 2024
a98499e
Move header comparison to _onTransferHeader function as there is no b…
schlagmichdoch Feb 14, 2024
42bd71a
Add error status and check if too many bytes are received
schlagmichdoch Feb 15, 2024
c0e5b66
Fix share menu error detection on iOS
schlagmichdoch Feb 14, 2024
aacf24c
Fix reconnecting by always accepting new ice candidates
schlagmichdoch Feb 14, 2024
90f1091
Fix _fileReceived getting called twice
schlagmichdoch Feb 15, 2024
f4a9475
Move service worker digestion into separate class and add static func…
schlagmichdoch Feb 15, 2024
74bd7dd
Check if RAM would be exceeded before using navigator.share()
schlagmichdoch Feb 16, 2024
0d17ada
NoSleep: Move evaluation if any peer is still busy to the PeerManager
schlagmichdoch Feb 16, 2024
3c8848d
Add STATE_TRANSFER_REQUEST_RECEIVED and close transfer request dialog…
schlagmichdoch Feb 16, 2024
00f1a20
Round progress to 4th digit to prevent weird progress bar behavior on…
schlagmichdoch Feb 16, 2024
e29ea44
Add transfer notes: Speed + Time left
schlagmichdoch Feb 17, 2024
8592499
Replace status: null with status: idle; Set status to processing imme…
schlagmichdoch Feb 17, 2024
d70f9d7
Remove redundant 'receive-progress' and move setting of progress to r…
schlagmichdoch Feb 17, 2024
3b772d0
Tidy up code of progress animation and make it linear; Tidy up code o…
schlagmichdoch Feb 17, 2024
07e46e4
Prevent flickering of text on load by adding defer="true" to deferred…
schlagmichdoch Feb 22, 2024
8a56a27
Make PWA run standalone (fixes #264)
schlagmichdoch Feb 23, 2024
9b3571f
Refactor BrowserTabsConnector and PeersManager
schlagmichdoch May 16, 2024
be381ea
When switching public rooms disconnect from devices in old room (fixe…
schlagmichdoch May 16, 2024
4b99ff4
Merge branch 'fix_public_room_switching' into sw_digester
schlagmichdoch May 16, 2024
f103f37
Merge branch 'sw_digester' into add_transfer_notes
schlagmichdoch May 16, 2024
5f6d330
Fix translations in default locale
schlagmichdoch May 16, 2024
51299bc
Refactor static variable names
schlagmichdoch May 16, 2024
fa86212
Merge branch 'master' into sw_digester
schlagmichdoch Jul 14, 2024
76c47c9
Rewrite FileDigester to tidy up code, be able to delete files in OPFS…
schlagmichdoch Jul 14, 2024
f7ea519
Do not stop trying to reconnect to server if offline (private network…
schlagmichdoch Jul 14, 2024
3b31472
Merge branch 'sw_digester' of https://github.com/schlagmichdoch/PairD…
schlagmichdoch Jul 14, 2024
db8d5f9
Merge branch 'add_transfer_notes' into sw_digester
schlagmichdoch Jul 14, 2024
b261cb7
Merge branch 'master' into sw_digester
schlagmichdoch Jul 17, 2024
1d5f2e8
Round kB/s as well
schlagmichdoch Jul 17, 2024
490bad5
Fix wrong file name with navigator.share
schlagmichdoch Aug 17, 2024
50539ed
Delete files from OPFS when user closes the ReceiveFileDialog
schlagmichdoch Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ <h2 class="dialog-title"></h2>
<div class="center file-preview"></div>
<div class="row-reverse center btn-row wrap">
<button id="share-btn" class="btn btn-rounded btn-grey" data-i18n-key="dialogs.share" data-i18n-attrs="text" hidden></button>
<button id="download-btn" class="btn btn-rounded btn-grey" data-i18n-key="dialogs.download" data-i18n-attrs="text" autofocus disabled></button>
<button id="download-btn" class="btn btn-rounded btn-grey" data-i18n-key="dialogs.download" data-i18n-attrs="text" autofocus disabled hidden></button>
<button class="btn btn-rounded btn-grey" data-i18n-key="dialogs.close" data-i18n-attrs="text" close></button>
</div>
</x-paper>
Expand Down Expand Up @@ -774,7 +774,7 @@ <h1>PairDrop</h1>
<script src="scripts/ui-main.js" defer></script>
<script src="scripts/main.js" defer></script>
<!-- Sounds -->
<audio id="blop" autobuffer="true">
<audio id="blop" preload="metadata" disableremoteplayback="true" x-webkit-airplay="deny" muted>
<source src="sounds/blop.mp3" type="audio/mpeg">
<source src="sounds/blop.ogg" type="audio/ogg">
</audio>
Expand Down
1 change: 0 additions & 1 deletion public/lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"pairing-cleared": "جميع الأجهزة غير مقترنة",
"notifications-enabled": "تم تمكين الإشعارات",
"online-requirement-pairing": "يجب أن تكون متصلاً بالإنترنت لإقران الأجهزة",
"ios-memory-limit": "لا يمكن إرسال ملفات إلى iOS إلا بحجم يصل إلى 200 ميجابايت مرة واحدة",
"online-requirement-public-room": "يجب أن تكون متصلاً بالإنترنت لإنشاء غرفة عامة",
"copied-text-error": "فشلت الكتابة من الحافظة. انسخ يدويًا!",
"download-successful": "تم تحميل {{descriptor}}",
Expand Down
1 change: 0 additions & 1 deletion public/lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
"pairing-cleared": "Tots els dispositius desvinculats",
"notifications-enabled": "Notificacions habilitades",
"online-requirement-pairing": "Has d'estar en línia per vincular dispositius",
"ios-memory-limit": "Tan sols és possible enviar fitxers de fins a 200 MB a iOS",
"online-requirement-public-room": "Cal que estiguis en línia per poder crear una sala pública",
"room-url-copied-to-clipboard": "Enllaç a la sala pública copiat al porta-retalls",
"copied-text-error": "L'escriptura al porta-retalls ha fallat. Copiar manualment!",
Expand Down
1 change: 0 additions & 1 deletion public/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
"message-transfer-completed": "Nachricht übertragen",
"rate-limit-join-key": "Rate Limit erreicht. Warte 10 Sekunden und versuche es erneut.",
"selected-peer-left": "Ausgewählter Peer ist gegangen",
"ios-memory-limit": "Für Übertragungen an iOS Geräte beträgt die maximale Dateigröße 200 MB",
"public-room-left": "Öffentlichen Raum {{publicRoomId}} verlassen",
"copied-to-clipboard-error": "Konnte nicht kopieren. Kopiere manuell.",
"public-room-id-invalid": "Ungültige Raum-ID",
Expand Down
13 changes: 10 additions & 3 deletions public/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@
"connecting": "Connecting…",
"files-incorrect": "Files are incorrect",
"file-transfer-completed": "File transfer completed",
"ios-memory-limit": "Sending files to iOS is only possible up to 200 MB at once",
"message-transfer-completed": "Message transfer completed",
"unfinished-transfers-warning": "There are unfinished transfers. Are you sure you want to close PairDrop?",
"rate-limit-join-key": "Rate limit reached. Wait 10 seconds and try again.",
"selected-peer-left": "Selected peer left"
"selected-peer-left": "Selected peer left",
"error-sharing-size": "Files too big to be shared. They can be downloaded instead.",
"error-sharing-default": "Error while sharing. It can be downloaded instead.",
"ram-exceed-ios": "One of the files is bigger than 250 MB and will crash the page on iOS. Use https and do not use private tabs on the iOS device to prevent this."
},
"document-titles": {
"file-received": "File Received",
Expand All @@ -176,9 +178,14 @@
"click-to-send-share-mode": "Click to send {{descriptor}}",
"click-to-send": "Click to send files or right click to send a message",
"connection-hash": "To verify the security of the end-to-end encryption, compare this security number on both devices",
"connecting": "Connecting…",
"preparing": "Preparing…",
"waiting": "Waiting…",
"processing": "Processing…",
"transferring": "Transferring…"
"transferring": "Sending…",
"receiving": "Receiving…",
"transfer-complete": "Sent",
"receive-complete": "Received",
"error": "Error"
}
}
1 change: 0 additions & 1 deletion public/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"pairing-cleared": "Todos los dispositivos han sido desemparejados",
"notifications-enabled": "Notificaciones habilitadas",
"online-requirement-pairing": "Debes estar en línea para emparejar dispositivos",
"ios-memory-limit": "Enviar archivos a iOS sólo admite hasta 200 MB a la vez",
"online-requirement-public-room": "Debes estar en línea para crear una sala pública",
"copied-text-error": "Error al escribir en el portapapeles. ¡Cópielo manualmente!",
"download-successful": "{{descriptor}} descargado",
Expand Down
1 change: 0 additions & 1 deletion public/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
"connecting": "Connexion…",
"files-incorrect": "Les fichiers sont incorrects",
"file-transfer-completed": "Transfert de fichier terminé",
"ios-memory-limit": "L'envoi de fichiers vers iOS n'est possible que jusqu'à 200 Mo à la fois",
"message-transfer-completed": "Transfert de message terminé",
"unfinished-transfers-warning": "Il y a des transferts inachevés. Êtes-vous sûr de vouloir fermer PairDrop ?",
"rate-limit-join-key": "Limite de débit atteinte. Attendez 10 secondes et réessayez.",
Expand Down
1 change: 0 additions & 1 deletion public/lang/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"pairing-cleared": "Semua Perangkat dilepaskan",
"notifications-enabled": "Notifikasi diaktifkan",
"online-requirement-pairing": "Anda harus online untuk memasangkan perangkat",
"ios-memory-limit": "Mengirim file ke iOS hanya dapat dilakukan hingga 200 MB sekaligus",
"online-requirement-public-room": "Anda harus online untuk membuat ruang publik",
"copied-text-error": "Menyalin ke papan klip gagal. Salinlah secara manual!",
"download-successful": "{{descriptor}} diunduh",
Expand Down
1 change: 0 additions & 1 deletion public/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"pairing-cleared": "Tutti i dispositivi sono stati dissociati",
"notifications-enabled": "Notifiche attivate",
"online-requirement-pairing": "Devi essere online per associare dispositivi",
"ios-memory-limit": "L'invio di file a dispositivi iOS è possibile solo 200 MB alla volta",
"online-requirement-public-room": "Devi essere online per creare una stanza pubblica",
"copied-text-error": "Scrittura negli appunti fallita. Copia manualmente!",
"download-successful": "{{descriptor}} scaricato",
Expand Down
1 change: 0 additions & 1 deletion public/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"pairing-cleared": "全てのデバイスとのペアリングを解除しました",
"notifications-enabled": "通知が有効になりました",
"online-requirement-pairing": "ペアリングするにはオンラインである必要があります",
"ios-memory-limit": "iOSへのファイル送信は一度に200MBまでしかできません",
"online-requirement-public-room": "公開ルームを作成するにはオンラインである必要があります",
"copied-text-error": "クリップボードにコピーできませんでした。手動でコピーしてください。",
"download-successful": "{{descriptor}}をダウンロードしました",
Expand Down
1 change: 0 additions & 1 deletion public/lang/kn.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"pairing-cleared": "ಎಲ್ಲಾ ಸಾಧನಗಳನ್ನು ಜೋಡಿಯಾಗಿ ತೆಗೆಯಲಾಗಿದೆ",
"notifications-enabled": "ಸೂಚನೆಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ",
"online-requirement-pairing": "ಸಾಧನಗಳನ್ನು ಜೋಡಿಸಲು ನೀವು ಆನ್‌ಲೈನ್‌ ಇರಬೇಕು",
"ios-memory-limit": "iOSಗೆ ಫೈಲ್‌ಗಳನ್ನು ಕಳುಹಿಸುವುದು ಒಂದೇ ಬಾರಿಗೆ 200 MB ವರೆಗೆ ಮಾತ್ರ ಸಾಧ್ಯವಾಗಿದೆ",
"online-requirement-public-room": "ಸಾರ್ವಜನಿಕ ಕೊಠಡಿಯನ್ನು ರಚಿಸಲು ನೀವು ಆನ್‌ಲೈನ್‌ ಇರಬೇಕು",
"room-url-copied-to-clipboard": "ಸಾರ್ವಜನಿಕ ಕೊಠಡಿಯ ಲಿಂಕ್ ಅನ್ನು ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ನಕಲಿಸಲಾಗಿದೆ",
"copied-text-error": "ಕ್ಲಿಪ್‌ಬೋರ್ಡ್‌ಗೆ ಬರೆಯುವುದು ವಿಫಲವಾಗಿದೆ. ಕೈಯಾರೆ ನಕಲಿಸಿ!",
Expand Down
1 change: 0 additions & 1 deletion public/lang/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"request-title": "{{name}} ønsker å overføre {{count}} {{descriptor}}",
"message-received": "Melding mottatt av {{name}} - Klikk for å åpne",
"files-incorrect": "Filene er uriktige",
"ios-memory-limit": "Forsendelse av filer til iOS er kun mulig opptil 200 MB av gangen",
"unfinished-transfers-warning": "Lukk med ufullførte overføringer?",
"rate-limit-join-key": "Forsøksgrense overskredet. Vent 10 sek. og prøv igjen."
},
Expand Down
1 change: 0 additions & 1 deletion public/lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"pairing-cleared": "Alle apparaten ontkoppeld",
"notifications-enabled": "Meldingen geactiveerd",
"online-requirement-pairing": "U moet online zijn om apparaten te koppelen",
"ios-memory-limit": "Bestandsoverdrachten naar iOS kunnen slechts met 200 MB per keer",
"online-requirement-public-room": "U moet online zijn om een openbare kamer te maken",
"copied-text-error": "Schrijven naar klembord mislukt. Kopieer handmatig!",
"download-successful": "{{descriptor}} downloaden",
Expand Down
1 change: 0 additions & 1 deletion public/lang/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
"connecting": "Conectando…",
"files-incorrect": "Os arquivos estão incorretos",
"file-transfer-completed": "Transferência de arquivo concluída",
"ios-memory-limit": "Enviar arquivos para iOS só é possível até 200 MB de uma vez",
"message-transfer-completed": "Transferência de mensagem concluída",
"unfinished-transfers-warning": "Há transferências inacabadas. Tem certeza de que deseja fechar o PairDrop?",
"rate-limit-join-key": "Limite de taxa atingido. Aguarde 10 segundos e tente novamente.",
Expand Down
1 change: 0 additions & 1 deletion public/lang/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"pairing-cleared": "Toate dispozitivele sunt decuplate",
"notifications-enabled": "Notificări activate",
"online-requirement-pairing": "Trebuie să fiți online pentru a asocia dispozitivele",
"ios-memory-limit": "Trimiterea de fișiere pe iOS este posibilă doar până la 200 MB simultan",
"online-requirement-public-room": "Trebuie să fiți online pentru a crea o cameră publică",
"copied-text-error": "Scrierea în clipboard a eșuat. Copiați manual!",
"download-successful": "{{descriptor}} descărcat",
Expand Down
1 change: 0 additions & 1 deletion public/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
"online-requirement": "Для сопряжения устройств вам нужно быть в сети.",
"files-incorrect": "Файлы неверны",
"message-transfer-completed": "Передача сообщения завершена",
"ios-memory-limit": "Отправка файлов на iOS устройства возможна только до 200 МБ за один раз",
"selected-peer-left": "Выбранный узел вышел",
"request-title": "{{name}} хотел бы передать {{count}} {{descriptor}}",
"rate-limit-join-key": "Достигнут предел скорости. Подождите 10 секунд и повторите попытку.",
Expand Down
1 change: 0 additions & 1 deletion public/lang/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
"files-incorrect": "文件不正确",
"file-transfer-completed": "文件传输已完成",
"connecting": "连接中…",
"ios-memory-limit": "向 iOS 发送文件 一次最多只能发送 200 MB",
"rate-limit-join-key": "已达连接限制。请等待 10秒 后再试。",
"public-room-left": "已退出公共房间 {{publicRoomId}}",
"copied-to-clipboard-error": "无法复制。请手动复制。",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"background_color": "#efefef",
"start_url": "/",
"scope": "/",
"display": "minimal-ui",
"display": "standalone",
"theme_color": "#3367d6",
"screenshots" : [
{
Expand Down
26 changes: 20 additions & 6 deletions public/scripts/browser-tabs-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@ class BrowserTabsConnector {
constructor() {
this.bc = new BroadcastChannel('pairdrop');
this.bc.addEventListener('message', e => this._onMessage(e));
Events.on('broadcast-send', e => this._broadcastSend(e.detail));
Events.on('broadcast-send', e => this._broadcastSend(e.detail.type, e.detail.data));
Events.on('broadcast-self-display-name-changed', e => this._onBroadcastSelfDisplayNameChanged(e.detail.displayName));
}

_broadcastSend(message) {
this.bc.postMessage(message);
_broadcastSend(type, data) {
this.bc.postMessage({ type, data });
}

_onBroadcastSelfDisplayNameChanged(displayName) {
this._broadcastSend('self-display-name-changed', { displayName: displayName });
}

_onMessage(e) {
console.log('Broadcast:', e.data)
switch (e.data.type) {
const type = e.data.type;
const data = e.data.data;

Logger.debug('Broadcast:', type, data);

switch (type) {
case 'self-display-name-changed':
Events.fire('self-display-name-changed', e.data.detail);
Events.fire('self-display-name-changed', data.displayName);
break;
}
}
Expand All @@ -25,6 +34,11 @@ class BrowserTabsConnector {
: false;
}

static isOnlyTab() {
let peerIdsBrowser = JSON.parse(localStorage.getItem('peer_ids_browser'));
return peerIdsBrowser.length <= 1;
}

static async addPeerIdToLocalStorage() {
const peerId = sessionStorage.getItem('peer_id');
if (!peerId) return false;
Expand Down
Loading