sindresorhus / caprine

Elegant Facebook Messenger desktop app
MIT License
7.04k stars 557 forks source link

Feat/proxy setting #2162

Open yosheng opened 7 months ago

yosheng commented 7 months ago

I need Caprine could proxy by setting without system proxy setting, so I add proxy setting in Advance Setting menu image

When I click proxy setting it will open a windows and show default setting. image

After click Enable and enter proxy server and relaunch caprine. Enjoy it 😎

Alex313031 commented 7 months ago

@yosheng I will add this to my fork that still supports Windows 7/8/8.1!

yosheng commented 7 months ago

@yosheng I will add this to my fork that still supports Windows 7/8/8.1!

I will be glad, this PR coluld help to your project too. 🥰

Alex313031 commented 7 months ago

@yosheng Two things I noticed, first, you have a redundant trailing </div> at the end under </script>

Second, this should be made into a regular .html file and put in //static, then loaded with a line like: win.loadFile(path.join(__dirname, '..', 'static/proxy.html'));

See my commit where I fixed all this (as well as migrated my own preload script to typescript, and renamed yours to proxy-preload.ts), as well as added a few styling changes to the window that I think look good > https://github.com/Alex313031/caprine-ng/commit/3742bbf1394dec7d7caf31a725b5dfb246f69356

yosheng commented 7 months ago

@Alex313031 I appreciate about your propose! I'am a electron newbee, those suggestions will help me to know how could make code clean. 🤩 I will do some change, then reopen this PR.

yosheng commented 7 months ago

I added some blue color like this. image

Alex313031 commented 7 months ago

@yosheng Looks good, I will include your styling in my fork.

Also, you indented your .html better, I will do that too lol.

Also, in case you were wondering, the Roboto font is to match up with the rest of Electron. Electron uses Roboto by default, and most of the Caprine UI is in that font.

Also, proxyWin.setMenuBarVisibility(false); is not needed since you already have autoHideMenuBar: true,.

yosheng commented 7 months ago

@Alex313031 Thanks for your advice! 😎