vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.51k stars 99 forks source link

Custom CSS doesn't modify the same area using Tor API as with regular API entry point #382

Closed lucknaumann closed 3 years ago

lucknaumann commented 3 years ago

Hi, and thanks for this great program!

I started using this last night and set up two accounts with it. I found some custom CSS for use with ProtonMail, and in trying them out, I noticed that using them with the Tor API entry point, not as much of the interface was modified versus the regular API entry point. Do you have any idea why this might be? Not sure this is a bug so much as something to do with Tor.

While I am using two different themes in the pictures, I have tried both on each account, and theme coverage is the same.

EM-Tor-CSS - Copy EM-Regular-CSS - Copy

vladimiry commented 3 years ago

The only meaningful difference between the mail.protonmail.com and protonirockerxow.onion web client bundles packed into the app lies in the index.[hash].js file (notice the API_URL='https://mail.protonmail.com/api' => API_URL='https://protonirockerxow.onion/api' change):

diff --git a/index.ef4096b9.js b/index.6db1e507.js
index 0410ef6..59995ad 100644
--- a/index.ef4096b9.js
+++ b/index.6db1e507.js
@@ -3908,7 +3908,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION_PATH", function() { return VERSION_PATH; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMIT_RELEASE", function() { return COMMIT_RELEASE; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SENTRY_DSN", function() { return SENTRY_DSN; });
-const CLIENT_ID='WebMail';const CLIENT_TYPE=1;const CLIENT_SECRET='';const APP_VERSION='4.1.28';const APP_NAME='proton-mail';const API_URL='https://mail.protonmail.com/api';const LOCALES={"ca_ES":"Català","de_DE":"Deutsch","en_US":"English","es_MX":"Español (México)","fr_FR":"Français","hr_HR":"Hrvatski","id_ID":"Bahasa (Indonesia)","it_IT":"Italiano","kab_DZ":"Taqbaylit","nl_NL":"Dutch","pl_PL":"Polski","pt_BR":"Português (Brasil)","pt_PT":"Português (Portugal)","ro_RO":"Română","ru_RU":"Русский","tr_TR":"Türkçe"};const API_VERSION='3';const DATE_VERSION='Fri, 26 Feb 2021 12:12:51 GMT';const CHANGELOG_PATH='/assets/changelog.tpl.html';const VERSION_PATH='/assets/version.json';const COMMIT_RELEASE='61280d0e7156c8e14c786e875f3def4f9f0c198f';const SENTRY_DSN='undefined';
+const CLIENT_ID='WebMail';const CLIENT_TYPE=1;const CLIENT_SECRET='';const APP_VERSION='4.1.28';const APP_NAME='proton-mail';const API_URL='https://protonirockerxow.onion/api';const LOCALES={"ca_ES":"Català","de_DE":"Deutsch","en_US":"English","es_MX":"Español (México)","fr_FR":"Français","hr_HR":"Hrvatski","id_ID":"Bahasa (Indonesia)","it_IT":"Italiano","kab_DZ":"Taqbaylit","nl_NL":"Dutch","pl_PL":"Polski","pt_BR":"Português (Brasil)","pt_PT":"Português (Portugal)","ro_RO":"Română","ru_RU":"Русский","tr_TR":"Türkçe"};const API_VERSION='3';const DATE_VERSION='Fri, 26 Feb 2021 12:13:30 GMT';const CHANGELOG_PATH='/assets/changelog.tpl.html';const VERSION_PATH='/assets/version.json';const COMMIT_RELEASE='61280d0e7156c8e14c786e875f3def4f9f0c198f';const SENTRY_DSN='undefined';

 /***/ }),

You can verify that independently by comparing the mail.protonmail.com and protonirockerxow.onion folders located in the app's ./resources/app.asar file (internal archive path: ./app/webclient, use asar to unpack the file).

So this makes me think that there is some misunderstanding on your side. I tend to treat the issue as "invalid" until the opposite is proven. You can provide the custom CSS stuff though so I could apply it on my side and see what happens.

Of course, technically @protonmail in their code might for some reasons mess with the DOM/elements-classes/attributes dynamically via JavaScript depending on the used API URL address but that would be a very weird thing to do and so it's unlikely to be taking place.

PS Notice that the app applies the custom CSS in a slightly different way than you do that in a regular browser, see #370. Means that a random CSS theme you find on the internet might look in the app somehow differently than was designed/tested by the theme author.

lucknaumann commented 3 years ago

Thanks for your response and willingness to look into this.

Well, in writing a reply, I realized that the fault is indeed mine. I thought I had set a dark theme in my ProtonMail "Tor" account. Like Dracula, I loathe the light. 😁 So, in that light, I am closing this issue as: "lame arse user."

FWIW: The CSS themes do look different in the app than the images displayed in the repo. Here is the source repo. CSS images are under Available themes expando: "Expand theme list." I zipped the different ones I tried. The ones in my posted images are Dracula for Regular and Ochin for Tor. CSS-themes.zip

Sidenote:

a random CSS theme you find on the internet...

Technically, isn't this a random program I found on the internet? 😀