chromeextension/popup.js

17 lines
605 B
JavaScript
Raw Normal View History

2024-05-27 19:37:06 +02:00
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
document.getElementById('lastCallDate').textContent = message.date;
document.getElementById('result').textContent = message.result;
return false;
});
document.addEventListener('DOMContentLoaded', function () {
// Get last call URL date and result
chrome.runtime.sendMessage({ type: 'sendState' });
// Add event listener to call URL button
document.getElementById('callURLBtn').addEventListener('click', function () {
chrome.runtime.sendMessage({ type: 'callURLManually' });
});
});