У меня есть время ожидания:
clockifyButton.popupTimer = setTimeout(() => {
popup.style.display = "none";
aBrowser.runtime.sendMessage(
{
eventName: "startWithDescription",
description,
subject: title,
tracker,
taskid,
tag,
projectId: clockifyButton.selectedProject.id
},
response => {
if (response.code === 400) {
alert(
"Can't end entry without project/task/description or tags.Please edit your time entry."
);
} else {
active = true;
setButtonProperties(button, title, active);
clockifyButton.inProgressDescription = title;
aBrowser.storage.sync.set({
timeEntryInProgress: response.data
});
}
}
);
}, 5000);
И я ищу решение, как я могу отправить сообщение, когда я очищаюTimeout (popupTimer) из другого источника. Спасибо вперед !!!