-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RetroYogi/1.0.3
1.0.3
- Loading branch information
Showing
4 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 1.0.0 | ||
Initial release | ||
|
||
# 1.0.3 | ||
## Bug fixes | ||
- Improvement: Added functionality to identify pinned tabs upon extension activation. This ensures the extension immediately recognizes which tabs are protected. (Implemented in background.js) | ||
- Fix: Resolved an issue where the extension blocked CMD-W (or Ctrl-W) for tabs that were previously pinned and then unpinned. Now, the extension only blocks the shortcut for currently pinned tabs. (Modified background.js) | ||
- Fix: Addressed a bug in content.js that caused a "TypeError: Cannot read properties of undefined (reading 'query')" error. The script now checks for extension availability before using the chrome.tabs API. (Modified content.js) | ||
- Fixed an issue where clicking a link to a different domain inside a pinned tab sometimes opened two new tabs instead of one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
// Intercept link clicks | ||
function isExtensionReady() { | ||
return !!chrome.tabs && !!chrome.tabs.query; // Check for both chrome.tabs and its query function | ||
} | ||
|
||
document.addEventListener('click', (event) => { | ||
const link = event.target.closest('a'); | ||
if (link && link.href) { | ||
chrome.runtime.sendMessage({ action: "openInNewTab", url: link.href }, (response) => { | ||
if (response.success) { | ||
event.preventDefault(); | ||
if (link && link.href && isExtensionReady()) { | ||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { | ||
if (tabs[0].pinned) { | ||
chrome.runtime.sendMessage({ action: "openInNewTab", url: link.href }); | ||
event.preventDefault(); // Prevent default behavior immediately | ||
} | ||
}); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters