-
-
Notifications
You must be signed in to change notification settings - Fork 806
Add customizable homepage #2648
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
base: master
Are you sure you want to change the base?
Conversation
Introduces a new customizable new tab page with clock, greeting, and search bar. Adds settings for enabling/disabling the homepage, choosing between default or custom URL, toggling clock and greeting, and selecting time format. Implements new internal protocols for 'min://newtab' and 'min://blank', updates localization, and refines related CSS and JS for the new tab and settings pages.
Updated the new tab page to use the currently selected search engine instead of a hardcoded DuckDuckGo URL. Added the searchEngine utility script to index.html and modified performSearch to construct the search URL dynamically.
|
That sounds good to me. I'll remove the new tab page and make it so that in the settings, you can choose either the NTP or a custom URL. A better implemetion of the NTP and the search bar interaction is something I will look into. I think the outline you gave will work well. I'll try to work on this sometime soon, but it might be a week or two. |
This reverts commit 08bf957.
Removed legacy homepage and new tab page code, including blank and custom homepage files and settings. Added new settings for new tab page: blank, custom URL, or background image, with UI and logic updates throughout the app. Updated CSS and JS to support new background image and custom URL options, and removed unused homepage-related code and translations.
|
Everything should be done. I moved the Custom URL into the Additional Settings. There is now a dropdown menu which has three options one for Blank, Custom URL, and NTP. I made sure that both the NTP widget and the preferences functionality are in sync. The changes to the new tab design have been made as well. I think the outline you gave worked great. Let me know if there are any changes or tweaks needed—its looking pretty good to me though. 9b59089 |
PalmerAL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good! I left some comments on the code, but I think the functionality is working well.
|
|
||
| .ntp-blur #ntp-background { | ||
| filter: blur(12px); | ||
| transform: scale(1.1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to eliminate the white edges around the blur, but I think the motion is distracting. What if we:
- Reduce the magnitude to
scale(1.03)- it looks like this is still enough to eliminate the white edges - Apply the scale to the image all the time, so that there's no motion when the blur is applied?
| */ | ||
|
|
||
| if (!options.openInBackground && !tabs.get(tabs.getSelected()).url && ((!tabs.get(tabs.getSelected()).private && tabs.get(tabId).private) || tabs.get(tabId).url)) { | ||
| destroyTab(tabs.getSelected()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be a case added to this if statement to destroy the current tab if it equals the NTP URL. Currently, if I close all my tabs, I get a single tab with the NTP; then if I create a new private tab, I get two tabs: one with the NTP, and a second with the private tab. I'd expect that the NTP would close when I create the new tab.
|
|
||
| // if the tab is a new, blank tab, replace it with the custom new tab page | ||
| let isCustomUrl = false | ||
| if (!tabs.get(tabId).url && !tabs.get(tabId).private) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be possible for a site to create a popup with no URL (I'm not sure exactly), in which case we shouldn't show the NTP. Perhaps we could solve that by also checking enterEditMode here, and only showing the NTP if it's true.
| // if the tab is a new, blank tab, replace it with the custom new tab page | ||
| let isCustomUrl = false | ||
| if (!tabs.get(tabId).url && !tabs.get(tabId).private) { | ||
| const newTabUrl = settings.get('newTabUrl') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this setting isn't a URL, could we rename it to something like newTabType?
| (newTabUrlMode === 'customUrl' && currentURL === settings.get('newTabCustomUrl')) | ||
|
|
||
| if (isNTP) { | ||
| searchbar.el.classList.add('searchbar-hidden') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just skip calling searchbar.showResults in this case (perhaps calling searchbar.hide instead if that's necessary), and then we no longer need the hidden class.
| blobInstance: null, | ||
| reloadBackground: function () { | ||
| const newTabUrl = settings.get('newTabUrl') | ||
| if (newTabUrl === 'blank') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the setting has never been modified, settings.get will return undefined, which this also needs to check for (ie since a blank page is the default value, undefined and "blank" should be treated the same way)
| "settingsNewTabUrlBlank": "Blank Page", | ||
| "settingsNewTabUrlCustomUrl": "Custom URL", | ||
| "settingsNewTabUrlBackgroundImage": "Background Image", | ||
| "settingsNewTabUrlUploadImage": "Upload Image", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to also add these as the title attributes of the camera and delete buttons on the new tab page.
| sendIPCToWindow(window, 'zoomOut') | ||
| } | ||
| }, | ||
| // Hidden item to enable shortcut on numpad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an accidental change, can you revert it?


Introduces a new customizable new tab page with clock, greeting, and search bar. Adds settings for enabling/disabling the homepage, choosing between default or custom URL, toggling clock and greeting, and selecting time format. Implements new internal protocols for 'min://newtab' and 'min://blank', updates localization, and refines related CSS and JS for the new tab and settings pages.



