Backspace key = "go back" as it was before Chrome 52
当前为
// ==UserScript==
// @name Backspace goes back
// @include *
// @description Backspace key = "go back" as it was before Chrome 52
// @version 1.0
// @author wOxxOm
// @namespace wOxxOm.scripts
// @license MIT License
// @run-at document-start
// ==/UserScript==
document.addEventListener('keyup', goBack);
function goBack(e) {
var el = document.activeElement;
if (e.keyCode != 8 || e.altKey || e.shiftKey || e.metaKey || e.ctrlKey ||
el && (el.isContentEditable ||
el.localName == 'input' && el.type.match(/^(text|color|date*|email|month|number|password|range|search|tel|time|url|week)$/) ||
el.localName == 'textarea'
)
) {
return;
}
history.back();
}