Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lihz6 committed Oct 26, 2017
1 parent 1f211b9 commit a583952
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/popup/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ document.addEventListener('DOMContentLoaded', () => {

const clickEls = document.querySelectorAll('[data-url]') as NodeListOf<HTMLElement>;

for (let i = 0; clickEls.length; i++) {
for (let i = 0; i < clickEls.length; i++) {
const el = clickEls[i];
// if (el && el.onclick) {
el.onclick = (event) => {
let path = (event.target as HTMLElement).getAttribute('data-url') as string;
if (path.indexOf(':') < 0) path = chrome.runtime.getURL(path);
let path = el.getAttribute('data-url') as string;
if (path.indexOf(':') < 0) {
path = chrome.runtime.getURL(path);
}
chrome.tabs.create({ url: path });
event.preventDefault();
window.close();
};
// }
}
});

0 comments on commit a583952

Please sign in to comment.