gecko/dom/browser-element/mochitest/file_inputmethod.html

22 lines
469 B
HTML

<html>
<body>
<script>
var im = navigator.mozInputMethod;
if (im) {
var intervalId = null;
// Automatically append location hash to current input field.
im.oninputcontextchange = function() {
var ctx = im.inputcontext;
if (ctx) {
intervalId = setInterval(function() {
ctx.replaceSurroundingText(location.hash);
}, 500);
} else {
clearInterval(intervalId);
}
};
}
</script>
</body>
</html>