Skip to content

Commit

Permalink
Update v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
easonwong-de committed Aug 27, 2023
1 parent 50abcb3 commit 86564fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ function controller(message) {
case "TPOH_ON":
clearInterval(updateInterval);
updateToggle = true;
update_debounce();
setTimeout(update_debounce, 100);
updateInterval = setInterval(update, 2500);
break;
case "TPOH_OFF":
clearInterval(updateInterval);
updateToggle = false;
break;
case "TPOH_UPDATE":
if (updateToggle) update_debounce();
if (updateToggle) setTimeout(update_debounce, 100);
break;
default:
break;
Expand All @@ -38,13 +38,13 @@ var debouncePrevRun = 0;
var debounceTimeout = null;

/**
* Runs the given function with a maximum rate of 500ms.
* Runs the given function with a maximum rate of 250ms.
* @param {function} fn Fuction without debounce.
* @returns Function with debounce.
* @author cloone8 on GitHub.
*/
function addDebounce(fn) {
const timeoutMs = 500;
const timeoutMs = 250;
return () => {
const currentTime = Date.now();
if (debounceTimeout) {
Expand Down Expand Up @@ -155,6 +155,7 @@ function updateTheme(theme, window) {
Promise.all(tabPreviews).then((tabPreviews) => {
theme.images = { additional_backgrounds: tabPreviews };
browser.theme.update(window.id, theme);
console.log(theme.colors.frame, Date.now());
});
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Tab Preview On Hover",
"version": "1.0",
"version": "1.1",
"description": "Adds on-hover tab preview to Firefox (requires CSS theme).",
"author": "Eason Wong",
"browser_specific_settings": {
Expand Down

0 comments on commit 86564fd

Please sign in to comment.