launch bookmarks based on day of the week, day of the month, daily and time range.
This is my take on the extension Morning Coffee from Firefox, which allows you to launch bookmarks based on the day of the week. I wrote this extension for my own use, and am sharing it in case anyone finds it useful.
1) create a bookmark folder named "mCoffee". If you have multiple folders with the same name, It will only process the first one found. If you run the extension without a folder named "mCoffee" in your bookmarks, the icon's badge will display "E1" on a red background.
2) Under the "mCoffee" folder, you can create the following subfolders (create only folders that you use, i.e. you don't need to create "Tue" if you don't have Tuesday specific bookmarks to launch)
- place bookmarks that you want to launch everyday in here
ii) Mon / Tue / Wed / Thu / Fri / Sat / Sun
- place bookmarks for specific days into the corresponding folder. e.g. urls in the "Sun" folder will be launched on Sundays
iii) 1 - 31
- place bookmarks for a specific day of the month here. For example, bookmarks in the folder "1" will be launched on the first day of the month (e.g. you want to check your bank statement every 1st day of the month).
- bookmarks that you want to launch from Mon - Fri
- bookmarks that you want to launch on Sat, Sun
- set conditions for launching bookmarks
- add the conditions as a comma separated list inside square brackets in the bookmark title, e.g. "Testing [2,Mon,Wed]" to launch the bookmark "Testing" on the 2nd of the month, Mondays and Wednesdays
- you can also add the conditions "AM" and "PM" for the bookmarks to launch in the morning only or afternoon e.g. "Testing [2,Mon,Wed,AM]" to launch "Testing" on the mornings of 2nd of the month, Mondays and Wednesdays
- if your bookmark title has 2 brackets, the first set gets processed. e.g. "[Mon,AM] Testing [Tue,PM]" will only be evaluated on the condition "Mon,AM"
- XX-YY to set between a time range, for example 19-21 to launch bookmarks between 7PM and 9PM inclusive.
This is a very basic extension, there is no configuration to be done. You need to manage the bookmarks using the bookmark manager. The plus side of using bookmarks instead of my own internal structure is the bookmarks are sync'ed using the standard Chrome mechanism. The downside is you'll end up with duplicate bookmarks (for example, you may have the same site for Mon and Wed). I don't do fancy.
The extension checks if the bookmark is already opened in an existing tab, if so it won't launch a duplicate tab. Note that some sites automatically expands / redirect the base url. For example, if you bookmarked https://mail.google.com the opened url will be https://mail.google.com/mail/. If you click on the extension icon again, it will open another tab for Gmail because "https://mail.google.com" doesn't match "https://mail.google.com/mail/".
Bookmarks are opened in the following folder order; Daily, day of week and day of month. Standalone folders are processed first, followed by the Rules folder. For example, if your "Daily" folder has the bookmarks "B1, B5" and your Rules folder has a Daily bookmark "B3", bookmarks are launched in the order B1, B5, B3.
Bookmarks within each folder are opened in the order they are found so you can sort your bookmarks if you want them opened in a particular order.
There is a 1 second delay between opening each tab.
When first started, the badge on the icon should show today's day on a green background.
If it can't find a bookmark folder named "mCoffee", the icon badge should show "E1" on a red background.
After you have clicked on the icon, the badge should show the day on a blue background.
THIS EXTENSION IS PROVIDED IN GOOD FAITH, HOWEVER I MAKE NO REPRESENTATION OR WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, REGARDING THE ACCURACY, ADEQUACY, VALIDITY, RELIABILITY, AVAILABILITY, FUNCTIONALITY
OR COMPLETENESS OF ANY INFORMATION ON THE EXTENSION.
UNDER NO CIRCUMSTANCE SHALL I HAVE ANY LIABILITY TO YOU FOR ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF THE USE OF THIS EXTENSION.
YOUR USE OF THE EXTENSION IS SOLELY AT YOUR OWN RISK.
This extension does not collect any personal data.
1) New bookmark subfolder, "Rules"
1) Rules - parse time range in 24h format, for example 19-21 to launch bookmarks between 7PM and 9PM inclusive.
2) Support new bookmark subfolders and rules keywords "Weekday", "Weekend"
1) code clean up
bookmarks - needed to search the bookmarks for the mCoffee and associated folders
tabs - needed to check that the url is not already opened, and to launch a new tab
Icon is from http://icongal.com/gallery/icon/34007/128/coffee_cup_breakfast_mocca
Legal Disclaimer adapted from https://termly.io/resources/templates/sample-disclaimer-template-guide/