Skip to content

Commit

Permalink
URL placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ostapenko committed Sep 23, 2024
1 parent 60dcdba commit a6e8f43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ const Popup = {
})
})

Array.from(document.querySelectorAll('a[href^="http"]')).forEach((a) => {
a.addEventListener('click', (event) => {
event.preventDefault()
event.stopImmediatePropagation()

open(a.href.replace(/__URL__/g, url))

return false
})
})

// Reload
el.emptyReload.addEventListener('click', (event) => {
chrome.tabs.reload({ bypassCache: true })
Expand Down

0 comments on commit a6e8f43

Please sign in to comment.