diff --git a/IPython/html/static/widgets/js/manager.js b/IPython/html/static/widgets/js/manager.js
index 3fae1f8..8ea6245 100644
--- a/IPython/html/static/widgets/js/manager.js
+++ b/IPython/html/static/widgets/js/manager.js
@@ -102,6 +102,13 @@ define([
});
};
+ // Use local storage to persist widgets across page refresh by default.
+ WidgetManager.set_state_callbacks(function() {
+ return JSON.parse(localStorage.widgets || '{}');
+ }, function(state) {
+ localStorage.widgets = JSON.stringify(state);
+ });
+
//--------------------------------------------------------------------
// Instance level
//--------------------------------------------------------------------