mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
27 lines
777 B
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>
|