Open PinkPandaKatie opened 2 years ago
When the title of a tab contains certain HTML elements, such as , viewing the group in the popup can fail with a spinning gear.
Steps to reproduce:
Traceback:
Uncaught (in promise) TypeError: can't access property "addEventListener", node.querySelector(...) is null tabNodes moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/Frame.js:111 getRenderedTabList moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/Frame.js:77 _renderTabList moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupDetailFrame.js:140 render moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupDetailFrame.js:16 _renderGroupListItem moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupsFrame.js:227 _renderGroupListItem moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupsFrame.js:226 _renderGroupList moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupsFrame.js:150 render moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/js/GroupsFrame.js:14 PopupView moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/index.js:19 PopupView moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/index.js:22 <anonymous> moz-extension://ada9b373-b62e-45a0-a5f0-02ddfa830e88/popup-view/index.js:11
This is almost certainly caused by failing to escape HTML in the title in the following code:
const node = getElementNodeFromString(` <li data-tab="${Tab.id}" class="list__item list__item--tab ${ isActive ? "list__item--highlight" : "" }" data-nav-row> <button class="list__link" title="${Tab.title} ${Tab.url}"> <img class="tab__icon" src="${Tab.favIconUrl}" width="16" height="16" alt="" /> <span>${Tab.title}</span> </button> <button class="list__close" title="${browser.i18n.getMessage("closeTab")}" ${options.hideCloseButton ? "hidden" : ""}></button> </li> `);
When the title of a tab contains certain HTML elements, such as
Steps to reproduce:
Traceback:
This is almost certainly caused by failing to escape HTML in the title in the following code: