When using Perplexity web UI (https://www.perplexity.ai/) with the GitHub Connector for Enterprise, every code edit, file creation, or PR action triggers an "Approve" popup dialog.
The Issue:
- You authorize the connector once during setup
- But EVERY write operation requires ANOTHER approval popup click
- Long operations (5+ minutes) timeout while waiting for the approval window
- If you step away, you miss the popup and the operation fails
- This is extremely counterproductive for autonomous workflows
Why it exists: For security/compliance reasons. But it creates UX friction for trusted users.
Why the web UI matters: Perplexity desktop app isn't available on Linux. Web UI is the only option.
Use a Tampermonkey userscript to automatically detect and click the "Approve" button the instant it appears.
Chrome/Brave/Edge:
- Visit: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
- Click "Add to Chrome"
Firefox:
- Visit: https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/
- Click "Add to Firefox"
Copy this script:
// ==UserScript==
// @name Perplexity Auto-Approve (Optimized v2.3)
// @namespace http://tampermonkey.net/
// @version 2.3
// @description Auto-clicks Approve button - OPTIMIZED for actual button structure
// @author You
// @match https://www.perplexity.ai/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
console.log('[Auto-Approve] Script loaded');
let lastCheckTime = 0;
let recentlyClicked = false;
function clickApprove() {
const now = Date.now();
if (now - lastCheckTime < 100 || recentlyClicked) return false;
lastCheckTime = now;
// ★ OPTIMIZED: Search only <button> elements (more reliable)
const buttons = document.querySelectorAll('button');
for (let i = 0; i < buttons.length; i++) {
const btn = buttons[i];
// Skip hidden buttons
if (btn.offsetParent === null) continue;
// Get button text content
const text = btn.textContent.trim();
// Check if it's the Approve button (exact match)
if (text === 'Approve') {
console.log('[Auto-Approve] Found Approve button:', btn);
btn.click();
recentlyClicked = true;
setTimeout(() => { recentlyClicked = false; }, 1000);
console.log('[Auto-Approve] ✓ Clicked Approve button');
return true;
}
}
return false;
}
// MutationObserver for instant detection
const observer = new MutationObserver((mutations) => {
for (let m of mutations) {
if (m.addedNodes.length > 0) {
setTimeout(clickApprove, 50);
break;
}
}
});
observer.observe(document.body, {
childList: true,
subtree: true,
attributes: false,
characterData: false
});
// Fallback polling (100ms interval)
setInterval(clickApprove, 100);
// Cleanup on page unload
window.addEventListener('beforeunload', () => observer.disconnect());
console.log('[Auto-Approve] Monitoring active - searching for <button>Approve</button>');
})();In Tampermonkey:
- Click the Tampermonkey icon in your browser toolbar
- Click "Create a new script"
- Delete all default content
- Paste the script above
- Press Ctrl+S to save
- Close the editor tab
- Go to https://www.perplexity.ai/
- Press F5 to reload the page (so script injects)
- Open DevTools Console: F12 → Console tab
- You should see:
[Auto-Approve] Script loaded
Trigger an Approval Popup:
Ask Perplexity any of these:
- "Create readme.md in my book repo"
- "Create a file in my repository"
- "Update the main README file"
The popup will appear, and your script will auto-click it within 50-150ms. Operation completes automatically.
Architecture:
- MutationObserver watches DOM for new elements (detects popup instantly)
- Fallback polling (every 100ms) catches popups if MutationObserver misses them
- When popup appears, script searches for
<button>elements - Finds the button with exact text match "Approve"
- Clicks it automatically
- 1-second cooldown prevents duplicate clicks
- Operation proceeds without user intervention
Performance:
- CPU overhead: < 0.5% on large threads (300K+ elements)
- Detection latency: 50-150ms (faster than manual)
- Memory: ~2MB
- No performance degradation with thread size
Q: Script isn't working
A:
- Check DevTools Console (F12 → Console)
- Look for
[Auto-Approve] Script loaded - If missing, reload page (F5)
- If still missing, verify Tampermonkey is enabled
- Try hard reload: Ctrl+Shift+R
Q: It found the button but didn't click
A:
- This shouldn't happen. If it does:
- Check console for errors
- Try
Ctrl+Shift+R(hard reload) - Consider reinstalling script
Q: Popup still appears sometimes
A: This is expected if you're looking at the screen. The script clicks within 50-150ms. If you see the popup, it means:
- The popup appeared and immediately disappeared (script clicked it)
- Or you were just fast enough to see it before the click
Q: Do I need to reload page after updating script?
A: YES. After editing the script in Tampermonkey and saving:
- Go back to Perplexity
- Press F5 (or Ctrl+Shift+R)
- The new version is now active
Why only search <button> elements?
- The Approve element is a real HTML
<button>element - Searching only buttons is ~5-10x faster than searching divs+buttons
- Avoids false positives from other page elements
- More reliable and semantically correct
On large threads (300K+ elements):
- MutationObserver scales well: detects popup within 1-2ms
- Polling fallback: scans ~50 buttons, not 300K elements
- Total overhead: < 1% CPU, ~2MB memory
- No slowdown as thread grows
The actual Approve button structure (for reference):
<div class="mt-4 flex items-center gap-2 ...">
<button type="button" class="bg-inverse text-inverse ...">
<div class="flex items-center ...">
<div class="relative ...">Approve</div>
</div>
</button>
<button type="button" class="...">
<div>...<div>Refine</div></div>
</button>
<button type="button" class="...">
<div>...<div>Skip</div></div>
</button>
</div>The script correctly identifies and clicks only the "Approve" button.
- Chrome/Chromium ✓ (v2.3 tested and working)
- Firefox (should work, uses same Tampermonkey)
- Edge (should work, uses Chromium)
- Brave (should work, uses Chromium)
- Web UI only - Works on https://www.perplexity.ai/
- Perplexity web connector only - Specific to GitHub Connector in web interface
- Not a full solution - Only addresses the approval popup friction
- Requires Tampermonkey - Browser extension needed
Option 1: Perplexity Desktop App
- Not available on Linux
- Only for macOS/Windows
Option 2: MCP Bridge (perplexity-web-mcp-extension)
- Over-complicated for this use case
- Requires local bridge process
- Overkill if you just want auto-approval
Option 3: Wait for Perplexity to fix it
- No ETA or acknowledgment of issue
- Users have reported this for months
This Script
- Simple (~80 lines)
- No external dependencies
- Lightweight
- Works today
MIT - Use freely, modify as needed
The latest version of this script is available from this Gist.
If you find improvements, feel free to adapt and share your own version.
Works great? Share this with others facing the same issue!