-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Can't save the notebook programmatically from JavaScript by simulating a click on the save button #7225
Comments
In triage, I'm accepting this issue. Your use case might be better suited to a Jupyter Notebook extension that actually runs the "save" command, rather than relying on JavaScript and queries for a specific button that might change in the future. |
@chrispyles - the action on the button is actually triggered on |
@fcollonval I tried emulating mousedown with |
When run with
From within an extension:
|
Description
When simulating a click on the save button element or its parent using JavaScript, the notebook is not saved.
This is needed in an R client library for otter-grader, where we need to programmatically save a notebook before exporting it into a zip file for submission. We have similar functionality in our Python client which was migrated to ipylab but there is no analog that I can find in R, so we need to use JavaScript to perform the save.
The issue also occurs in JupyterLab and from my understanding notebook v7 is basically a reskin of JupyterLab so I wasn't sure which repo to open this under, but the user who opened our bug about this (ucbds-infra/otter-grader#767) is using notebook, so I figured I'd open it here. Please let me know if it should be moved.
Reproduce
This can also be reproduced in the browser's console by just running the JS:
Expected behavior
When a click is simulated on the button element with JavaScript, the notebook should be saved.
Context
Output of
jupyter --version
:Troubleshoot Output
See attachment: troubleshoot.txt
Command Line Output
See attachment: jupyter logs.txt
Browser Output
The text was updated successfully, but these errors were encountered: