Skip to content
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

Migrate from DOM parsing to the Canvas API #56

Merged
merged 14 commits into from
Jul 19, 2022
Merged

Migrate from DOM parsing to the Canvas API #56

merged 14 commits into from
Jul 19, 2022

Conversation

JamesNZL
Copy link
Owner

@JamesNZL JamesNZL commented Jul 19, 2022

Migrates from parsing the rendered HTML markup of an Assignments page to making proper API calls.

Changes

From the injected content script, we can make same-host fetch() requests with the user's own authentication cookies, without any extra extension permissions or Canvas authentication (eg Bearer) tokens.

Benefits

This is a massive improvement in reliability and universality, as there are instances where certain course staff choose not to publish the Assignments page, in which case this extension would not work.

Further, it removes the reliance on the configured HTML class options, which is very welcome.

It also enables the extension to access the full details about each assignment enabling inclusion of things such as points or the assignment description into each imported Notion page.

Dependencies

Removes the dependency on chrono-node to parse plain-language dates, as unlock_at and due_at are now provided directly by the API in ISO 8601 format.

Smaller bundle size!

@JamesNZL JamesNZL merged commit f3a3b3e into main Jul 19, 2022
@JamesNZL JamesNZL deleted the canvas-api branch July 19, 2022 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant