diff --git a/js/background.js b/js/background.js
index 163dd79..cbc97d2 100644
--- a/js/background.js
+++ b/js/background.js
@@ -40,7 +40,7 @@ chrome.runtime.onInstalled.addListener(function () {
"better_todo": false,
"todo_hr24": false,
"todo_separate_scrollbar": false,
- "better_sidebar": true,
+ "better_sidebar": false,
"condensed_cards": false,
"custom_cards": {},
"custom_cards_2": {},
@@ -77,7 +77,7 @@ chrome.runtime.onInstalled.addListener(function () {
"assignment_states": {},
"tab_icons": false,
"todo_hide_feedback": false,
- "todo_full_height": false,
+ "todo_full_height": true,
"device_dark": false,
"cumulative_gpa": { "name": "Cumulative GPA", "hidden": false, "weight": "dnc", "credits": 999, "gr": 3.21 },
// "show_updates": false,
diff --git a/js/content.js b/js/content.js
index 19b1048..9ad9f00 100644
--- a/js/content.js
+++ b/js/content.js
@@ -1354,81 +1354,8 @@ function setupBetterSidebar(mode = "dash") {
let sidebarContent = makeElement("div", sidebarList, {
style: "display:flex;flex-direction:column;gap:20px;width:100%;flex:1;justify-content:flex-start;align-items:center;margin:40px;"
});
- // sidebar contents
- createSidebarButton("Dashboard", domain + "/", sidebarContent,
- ``,
- );
- createSidebarButton(
- "Courses",
- domain + "/courses",
- sidebarContent,
- ``,
- );
- createSidebarButton(
- "Groups",
- domain + "/groups",
- sidebarContent,
- ``,
- );
- createSidebarButton(
- "Calendar",
- domain + "/calendar",
- sidebarContent,
- ``,
- );
- createSidebarButton(
- "Inbox",
- domain + "/conversations",
- sidebarContent,
- ``,
- );
- createSidebarButton(
- "Studio",
- domain +
- "accounts/1/external_tools/69?launch_type=global_navigation",
- sidebarContent,
- ``,
- );
+ // Populate sidebar from Canvas navigation menu dynamically
+ populateSidebarFromNav(sidebarContent);
if (mode == "course") {
makeElement("h1", sidebarContent, {
@@ -1485,6 +1412,45 @@ function createSidebarButton(text, url, parent, icon) {
});
button.innerHTML = `${icon ? `${icon}` : ``}`;
}
+function populateSidebarFromNav(sidebarContent) {
+ const excludeIds = ["global_nav_help_link", "global_nav_history_link"];
+ const customIcons = {
+ "global_nav_profile_link": ``,
+ "global_nav_dashboard_link": ``,
+ "global_nav_conversations_link": ``,
+ "global_nav_calendar_link": ``,
+ "global_nav_courses_link": ``,
+ "global_nav_groups_link": ``,
+ "globalNavExternalTool-69": ``,
+ };
+
+ const navMenu = document.getElementById("menu");
+ if (!navMenu) return;
+
+ const menuItems = navMenu.querySelectorAll(".menu-item a[id^='global_nav'], .globalNavExternalTool a");
+ menuItems.forEach(item => {
+ const itemId = item.id || item.closest(".menu-item")?.id;
+ if (excludeIds.includes(itemId)) return;
+
+ const href = item.getAttribute("href");
+ const textEl = item.querySelector(".menu-item__text");
+ const text = textEl?.textContent?.trim();
+
+ if (!text || !href) return;
+
+ let icon = customIcons[itemId] || "";
+ if (!icon) {
+ const svg = item.querySelector("svg");
+ if (svg) {
+ icon = svg.outerHTML;
+ // Make SVG white by adding style
+ icon = icon.replace("