Splode / pomotroid

:tomato: Simple and visually-pleasing Pomodoro timer
https://splode.github.io/pomotroid/
MIT License
4.36k stars 369 forks source link

Websocket for 3rd Party Integration & Electron Version Bump #156

Closed TCWTEAM closed 3 years ago

TCWTEAM commented 3 years ago

Pomotroid is nice but the one thing I've always felt is missing is a site blocker. One method to do this would be to edit the local computer hosts file however, this can cause permission issues, unintended behavior, and be easily avoidable as chrome can preserve socket pools and prevent another lookup, making the hosts file useless.

Another method is by exposing a WebSocket that communicates work rounds starting or stopping which is much better and what this PR does.

The code is currently very messy however I just wanted to see if this is something that would be possible to implement before spending time and cleaning it up. If so, a todo of tasks before this is prod ready:

Here is a functional sample of a site-blocking chrome extension I use with this branch of pomotroid https://github.com/TCWTEAM/Pomotroid-Extension

TLDR: Add WebSockets to be able to add 3rd party integrations, specifically a site-blocker

TCWTEAM commented 3 years ago

Would also resolve #146

Splode commented 3 years ago

@TCWTEAM Looks good. Thank you for the contribution.

I like the idea of having a generalized web socket server for sharing data within and without the app. I've been wanting to create a plug-in system for a while, and this is a great step toward that. With that I mind, your goal of abstracting the socket logic into an extendable format would be helpful.

I'd say if you intend to continue working on this a bit more before we ship it, can you amend this PR to the dev branch?

TCWTEAM commented 3 years ago

@TCWTEAM Looks good. Thank you for the contribution.

I like the idea of having a generalized web socket server for sharing data within and without the app. I've been wanting to create a plug-in system for a while, and this is a great step toward that. With that I mind, your goal of abstracting the socket logic into an extendable format would be helpful.

I'd say if you intend to continue working on this a bit more before we ship it, can you amend this PR to the dev branch?

Changed it to dev. I'm going to try abstracting the logic and cleaning things up sometime this week and hopefully have this ready to ship by next week

Also another unintended consequence of this pr is its pretty easy to ship arm builds now for native apple silicon support

Splode commented 3 years ago

Also another unintended consequence of this pr is its pretty easy to ship arm builds now for native apple silicon support

Brilliant! Thanks!