deepjyoti30 / startpage

A minimal starpage for Chrome and Firefox
MIT License
630 stars 86 forks source link

Is there any way to customize the message? #27

Closed MathematicsUnicorn closed 4 years ago

MathematicsUnicorn commented 4 years ago

Title says it all, have been using this for a few hours, pretty cool! Would be nice if we could customize the message as well :)

deepjyoti30 commented 4 years ago

@P1nkBug How do you want to customize it?

Currently the message changes based on the time of the day. Would you like to change that to a static message?

I think adding a dynamic message array that would be cycled through based on the time of the day would be a bit costly.

MathematicsUnicorn commented 4 years ago

Hey @deepjyoti30 ! Thanks for the reply! I was thinking more like a static message!

deepjyoti30 commented 4 years ago

@P1nkBug Sure, lemme work on that, I would have to make some changes but I have always considered allowing the flexibility to change the message.

deepjyoti30 commented 4 years ago

Hey @P1nkBug I have added a commit. Check 0e83664

It adds the ability to set a static custom message through the config. It is not added in the config by default but when added, it will override the default dynamic message.

I have also updated the settings table in README if you'd want to take a look at it.

Consider trying out the commit and you can report back here in case of bugs or something. Cheers!

MathematicsUnicorn commented 4 years ago

@deepjyoti30 So I updated the main.js file and then changed the config like this

"searchEngine":"Google", "user": "Pinkbug", "disableMessage": true, "message": "My message here" "disableDate": false, "disableSearchBar": false,

But it doesn't changes the message on the startpage which is the same as before. Don't know if I missed something or not

MathematicsUnicorn commented 4 years ago

@deepjyoti30 I also tried "disableMessage": false,

deepjyoti30 commented 4 years ago

@P1nkBug Yeah I think the issue is you'll have to rebuild the extension and then install it.

If you want to try it right away, change the debug variable in main.js to true

It'll work then. When the debug is false, the config is read from browsersStorage.

Another fix would be to add the new message field by opening the stored config file using --setting and the changing the internal config. But then before that you'll have to build the newer version.

So the easier way would be to change that debug variable and try.

MathematicsUnicorn commented 4 years ago

@deepjyoti30 sorry for the late response. I tried changing the debug to true but when I open a new tab it just gets stuck on "fetching...". Also tried removing and rebuilding the extension and switching DisplayMessage in Json between true and false.

MathematicsUnicorn commented 4 years ago

@deepjyoti30 So basically I'm an idiot and I screwed up a semicolon in main.js :P I had actually found a workaround even if "message" in Json didn't work by going in main.js and changed the if/else block in the handleMessage function to basically always return the same thing which was my custom message. Only reason I kept digging was because your code was obviously bug free and I couldn't understand what the problem was until I noticed that I had messed up the syntax :/ Anyways, thanks for the help and the quick responses!

deepjyoti30 commented 4 years ago

@P1nkBug Glad you got it to work. Feel free to close the issue if your issue is been solved.

I am sure people would be able to use the message field from the next release.