Migrate from DOM
parsing to the Canvas API
#56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, asunlock_at
anddue_at
are now provided directly by the API inISO 8601
format.