diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4459d60..f95a3380 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,6 +140,12 @@ A good example is [this commit](https://github.com/cxw42/TabFern/commit/3ac0f274 for more documentation of the available options. - Edit the values appropriately. +### Miscellaneous + +- If you add a name ending with `id` (in any case), and it's not all + upper-case, please spell it `Id` rather than `ID` or `id`. That will help + avoid bugs like #304. Thanks! + ## Notes about dependencies The following dev dependencies are listed in `package.json` but **not used** diff --git a/app/bg/background.js b/app/bg/background.js index f60a333d..63eaccda 100644 --- a/app/bg/background.js +++ b/app/bg/background.js @@ -18,7 +18,7 @@ const S = require('common/setting-definitions'); // in app/ /// The module exports, for use in command-line debugging let me = { - viewWindowID: undefined, // the chrome.windows ID of our view + viewWindowId: undefined, // the chrome.windows ID of our view loadView: undefined, }; @@ -46,8 +46,8 @@ me.loadView = function loadView() // However, Firefox does support windows.update with focused. }, function(win) { - me.viewWindowID = win.id; - console.log('TabFern new View ID: ' + me.viewWindowID.toString()); + me.viewWindowId = win.id; + console.log('TabFern new View ID: ' + me.viewWindowId.toString()); chrome.windows.update(win.id, {focused:true}, ignore_chrome_error); }); } //loadView() @@ -63,8 +63,8 @@ function moveTabFernViewToWindow(reference_cwin) function clip(x, lo, hi) { if(hi +
  • Bugfixes ${issue(304)}
  • + +` + ), + + }, { "tab": future_i18n("What's new?"), "group": `Version 0.3.0${brplain('2022-12-09')}`, diff --git a/app/win/main_tl.js b/app/win/main_tl.js index 116c0edf..4ba1204e 100644 --- a/app/win/main_tl.js +++ b/app/win/main_tl.js @@ -183,7 +183,7 @@ function escapeRegExp(string) { /// Get the node ID from a NEW_TAB_URL. Returns falsy on failure, or the ID /// on success. -function getNewTabNodeID(ctab) { +function getNewTabNodeId(ctab) { if(!ctab || !(ctab.url || ctab.pendingUrl)) return false; let hash; try { @@ -203,7 +203,7 @@ function getNewTabNodeID(ctab) { } return hash; -} //getNewTabNodeID +} //getNewTabNodeId ////////////////////////////////////////////////////////////////////////// }}}1 // General record helpers // {{{1 @@ -2541,7 +2541,7 @@ var onTabCreated = (function(){ // search key: function onTabCreated() /// @return {Boolean} true if we handled the action, false otherwise function handle_tabfern_action(tab_val, ctab) { - let tab_node_id = getNewTabNodeID(ctab); + let tab_node_id = getNewTabNodeId(ctab); if(!tab_node_id) return false; // Not a NEW_TAB_URL // See if the hash is a node ID for a tab. @@ -2742,15 +2742,10 @@ function onTabReplaced(addedTabId, removedTabId) { log.info(`Tab being replaced: ${removedTabId} -> ${addedTabId}`); - const errmsg = M.react_onTabReplaced(addedTabID, removedTabId); + const errmsg = M.react_onTabReplaced(addedTabId, removedTabId); if(typeof(errmsg) === 'string') { - log.warn(`Could not replace ${removedTabId} with ${addedTabId}: ${errmsg}`); - return; - } else { - log.debug({ - [`Tab replacement ${removedTabId}->${addedTabId}: new value`]:tab_val - }); + throw new Error(`Could not replace ${removedTabId} with ${addedTabId}: ${errmsg}`); } } //onTabReplaced diff --git a/package.json b/package.json index 09f8fd99..82043a2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabfern", - "version": "0.3.0", + "version": "0.3.1-pre.2", "description": "Google Chrome extension for displaying, saving, and managing tabs", "main": "src/view/main.js", "directories": { diff --git a/vendor/common.js b/vendor/common.js index a4565407..adf93554 100644 --- a/vendor/common.js +++ b/vendor/common.js @@ -13,7 +13,7 @@ console.log('TabFern common.js loading'); // { msg: [, anything else] } // For responses, response:true is also included. -const MSG_GET_VIEW_WIN_ID = 'getViewWindowID'; +const MSG_GET_VIEW_WIN_ID = 'getViewWindowId'; const MSG_EDIT_TAB_NOTE = 'editTabNote'; ////////////////////////////////////////////////////////////////////////// }}}1