Skip to content

Commit 9818f31

Browse files
committed
Lab: use ServerConnection.makeRequest to include xsrf
1 parent db7fb91 commit 9818f31

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@jupyterlab/coreutils": "^5.0.0 || ^6.0.0",
5757
"@jupyterlab/docregistry": "^3.0.0 || ^4.0.0",
5858
"@jupyterlab/notebook": "^3.0.0 || ^4.0.0",
59+
"@jupyterlab/services": "^6.0.0 || ^7.0.0",
5960
"@lumino/disposable": "^1.4.3 || ^2.0.0",
6061
"@lumino/widgets": "^1.17.0 || ^2.0.0",
6162
"@types/jquery": "^3",

src/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { IDisposable, DisposableDelegate } from '@lumino/disposable';
33
import { Widget } from '@lumino/widgets';
44

55
import { PageConfig } from '@jupyterlab/coreutils';
6+
import { ServerConnection } from '@jupyterlab/services';
67

78
import {
89
JupyterFrontEnd,
@@ -306,10 +307,12 @@ function showBinderLink<T>(panel: NotebookPanel): Promise<Dialog.IResult<T>> {
306307
function activate(app: JupyterFrontEnd): void {
307308
console.log('Activating jupyter-offlinenotebook JupyterLab extension');
308309
const baseUrl = PageConfig.getBaseUrl();
309-
$.getJSON(baseUrl + 'offlinenotebook/config', (data) => {
310-
offline.initialise(data);
311-
// addButtons();
312-
});
310+
const settings = ServerConnection.makeSettings();
311+
ServerConnection.makeRequest(
312+
baseUrl + 'offlinenotebook/config',
313+
{},
314+
settings,
315+
);
313316
app.docRegistry.addWidgetExtension('Notebook', new OfflineNotebookButtons());
314317
}
315318

0 commit comments

Comments
 (0)