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

27 lines
777 B
HTML

<!DOCTYPE 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) {
dump('inputcontext is received for input method ' + location.hash + '\n');
intervalId = setInterval(function() {
dump('sending text in input method ' + location.hash + '\n');
ctx.replaceSurroundingText(location.hash);
}, 500);
} else {
dump('inputcontext is removed for input method ' + location.hash + '\n');
clearInterval(intervalId);
}
};
}
</script>
<p>This frame representing the input method frame.</p>
</body>
</html>