18 lines
447 B
JavaScript
18 lines
447 B
JavaScript
document.getElementById("copy").onclick = () => {
|
|
document.getElementById("latex").select();
|
|
document.execCommand('copy');
|
|
}
|
|
|
|
const insertResult = (result) => {
|
|
|
|
katex.render(result, document.getElementById('katex'), {
|
|
throwOnError: false,
|
|
displayMode: true
|
|
});
|
|
|
|
document.getElementById('latex').value = result;
|
|
}
|
|
|
|
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
insertResult(message.content);
|
|
}); |