How to use the evt.canUseProtocol function in evt

To help you get started, we’ve selected a few evt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leanote / desktop-app / node_modules / server.js View on Github external
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();
	},
github leanote / desktop-app / node_modules / note.js View on Github external
fixContentUrl: function(content) {
		if (!content) {
			return content;
		}
		if (Evt.canUseProtocol()) {
			return content.replace(/http:\/\/127.0.0.1:8912\/api\//g, 'leanote://');
		}
	},