Showing posts with label crx. Show all posts
Showing posts with label crx. Show all posts

March 15, 2024

Confluence Chrome/ FireFox Extension

This post briefly announces my Chrome/FireFox Extension for Confluence.
Updated 2026-05-08
 

March 13, 2024

Chrome extension: Get storage data

I share here a recent learning about Chrome extension programming and getting storage data.

Confluence Numbered Headings in Chrome Extension

Following-up on a previous post (that was using a poor approach with bookmarklets), I share a better solution to number headings in Confluence using a Chrome Extension.

Chrome Extension: Popup with clickable links

I share here some recent learning about how to make links in the popup of Chrome extension directly clickable.

October 8, 2020

Chrome Extension: View source

This is a recurring question I always have to look out: How to view the source code of a Chrome Extension?

I document here the step-by-step answer.

September 18, 2020

Quick Share a link to Microsoft Teams

I have discovered recently by chance this nice feature: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/share-to-teams that allows to quickly share a link from the browser into a Microsoft Teams Channel.
I share here my learnings and how to integrate this feature e.g. to a hotkey.

July 3, 2020

Chrome Extension: Close Current Tab

Introduction I've faced the challenge in a Chrome extension to close the current tab - and the chrome window if this Tab is the last one.

Standard answer

chrome.tabs.query({"active": true, "lastFocusedWindow": true}, function (tabs) {
chrome.tabs.remove(tabs[0]);
});
The drawback of this solution is that it won't close the Chrome window if it is the last tab to be closed.

My solution (close window if last tab)

/ ----------------------------------------------------------------------------------------------------------
function closeCurrentTab(){
// Close current tab and browser window if last tab
// chrome.tabs.remove will not close the window on last tab closure -> needs to check if single tab opened
chrome.tabs.query({
    //active: true,
    currentWindow: true
}, function(tabs)   {
    if (tabs.length > 1{
        chrome.tabs.query({
            active: true,
            currentWindow: true
        }, function(tabs)   {
        chrome.tabs.remove(tabs[0].id, function() { });
        });
    } else {
        chrome.windows.getCurrent(function(win) {
            chrome.windows.remove(win.id, function() { });
        });
    }       
});