Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
close: function(callback) {
this._started = false;
// 注销prototol, 如果频繁刷新, 会报错, calling a released render
if (Evt.canUseProtocol()) {
protocol.unregisterProtocol('leanote', function (ok) {
console.log('unregisterProtocol: ' + ok)
callback && callback();
});
return;
}
this.server.close(function(err) {
});
this._started = false;
callback && callback();
},
fixContentUrl: function(content) {
if (!content) {
return content;
}
if (Evt.canUseProtocol()) {
return content.replace(/http:\/\/127.0.0.1:8912\/api\//g, 'leanote://');
}
},