Skip to main content

Overview

The Knowledge Tooltip extension can be toggled on or off from the popup menu. When disabled, the extension will not inject its content script or show tooltips on any page.

Accessing Settings

Click the Knowledge Tooltip icon in your Chrome toolbar to open the popup menu. Extension popup menu

Extension Status Toggle

The first section of the popup contains a toggle switch that controls whether the extension is active.
1

Open the extension popup

Click the Knowledge Tooltip icon in your browser toolbar
2

Toggle the switch

Click the toggle switch next to “Extension Status”
3

Verify the status

The status text below will update to show ”✓ Active” or ”✗ Inactive”

How It Works

The extension status is stored using Chrome’s storage API and synced across your devices:
// Load saved state from chrome.storage.sync
const result = await chrome.storage.sync.get(['enabled', 'language']);
const isEnabled = result.enabled !== false;

// Update the toggle
toggle.checked = isEnabled;
When you toggle the extension:
// Save the new state
toggle.addEventListener('change', async (e) => {
  const enabled = e.target.checked;
  
  await chrome.storage.sync.set({ enabled });
  updateStatusText(enabled);
  
  // Notify all tabs about the change
  const tabs = await chrome.tabs.query({});
  tabs.forEach(tab => {
    chrome.tabs.sendMessage(tab.id, {
      action: 'toggleExtension',
      enabled
    }).catch(() => {});
  });
});
The setting is stored in chrome.storage.sync, which means your preference will sync across all Chrome browsers where you’re signed in.

Default State

By default, the extension is enabled when first installed. The code uses this logic:
const isEnabled = result.enabled !== false;
This means:
  • If no value is stored yet → enabled = true
  • If explicitly set to falseenabled = false
  • If set to trueenabled = true

Real-Time Updates

When you toggle the extension, all open tabs are immediately notified:
  • Enabled: The content script starts listening for text selections
  • Disabled: The content script stops showing the Knowledge button and removes any active tooltips
// In content.js
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
  if (message.action === 'toggleExtension') {
    isEnabled = message.enabled;
    if (!isEnabled) {
      removeButton();
      removeTooltip();
    }
  }
});
Disabling the extension does not clear your API key or language preferences. These settings are preserved when you re-enable the extension.

Status Indicators

The popup displays a visual status indicator:
  • Active: Green checkmark with ”✓ Active” text
  • Inactive: Red cross with ”✗ Inactive” text
function updateStatusText(enabled) {
  if (enabled) {
    statusText.textContent = '✓ Active';
    statusText.className = 'status active';
  } else {
    statusText.textContent = '✗ Inactive';
    statusText.className = 'status inactive';
  }
}

Troubleshooting

Try refreshing the page. The content script needs to be re-injected for changes to take effect on already-loaded pages.
Check if you have any browser policies that might be overriding extension settings. Contact your IT administrator if you’re on a managed device.
This usually indicates a permissions issue. Try reinstalling the extension and granting the required permissions.

Build docs developers (and LLMs) love