VK: Hide Typing

Hide Typing

As of 2019-07-26. See the latest version.

// ==UserScript==
// @name         VK: Hide Typing
// @namespace    hidetyping.user.js
// @version      0.1
// @match        https://vk.com/*
// @description Hide Typing
// ==/UserScript==

(() => {
	const listener = () => {
		const { send } = XMLHttpRequest.prototype;

		XMLHttpRequest.prototype.send = function (data) {
			if (/typing/.test(data)) {
				this.abort();
			}

			send.call(this, data);
		};
	};

	const script = document.createElement('script');
	script.setAttribute('type', 'text/javascript');
	script.textContent = `(${listener.toString()})()`;
	document.head.append(script);
})();