iFrame based AI bridge that acts as an API for web apps.
This framework loads AI chat websites (like Claude) inside a Chrome extension sidebar, then exposes a simple message interface so any other extension can send a question and get an answer back as plain text. This framework has no API key or backend service dependency. This framework is also free to use and for educational purposes only.
your extension
|
| chrome.runtime.sendMessage(PSEUDO_API_ID, { action: 'ASK_AI', question: '...' })
v
pseudo-api background (service worker)
|
| port.postMessage({ action: 'ASK', ... })
v
sidepanel.js (sidebar controller)
|
| frame.contentWindow.postMessage({ action: 'ASK', ... })
v
provider script (injected into ai site iframe)
|
| types question, waits for answer
|
| window.parent.postMessage({ action: 'AI_ANSWER', answer: '...' })
v
sidepanel.js -> port -> background -> your extension callback
Go to chrome://extensions, enable Developer mode, click Load unpacked, select the pseudo-api folder.
Copy the extension ID shown on the card.
Click the pseudo-api icon in your toolbar. The sidebar opens. Select a provider from the dropdown and wait for it to show "ready".
You need to be logged into whichever AI website you choose.
var PSEUDO_API_ID = 'paste-your-extension-id-here';
chrome.runtime.sendMessage(PSEUDO_API_ID, {
action: 'ASK_AI',
question: 'What is the capital of France?'
}, function (res) {
if (res.error) {
console.error(res.error);
return;
}
console.log(res.answer);
});There are three ways to test pseudo-api:
Type your prompt directly into the "Test API prompt..." bar at the top of the sidebar panel and click Send. The response appears immediately in the green output area above the status bar.
Open DevTools (F12) on any tab and run:
var PSEUDO_API_ID = 'your-extension-id-here';
chrome.runtime.sendMessage(PSEUDO_API_ID, { action: 'ASK_AI', question: 'Hello!' }, console.log);- Open
demo/popup.jsand replaceYOUR_PSEUDO_API_EXTENSION_IDwith your extension ID - Go to
chrome://extensionsand click Load unpacked -> selectdemo/ - Click the demo extension icon in your toolbar to open its popup UI, type a question, and click Send
| Provider | URL loaded |
|---|---|
| Gemini | gemini.google.com/app |
| Claude | claude.ai/new |
| ChatGPT | chatgpt.com |
| Google AI Mode | google.com/search?udm=50 |
To add a new provider of your choice, see provider-guide.md.
See api-contract.md for all message types.
Most of the AI sites that we use, send X-Frame-Options: DENY headers, which blocks them from loading in iframes. My pseudo-api uses the declarativeNetRequest API to strip those headers before the browser processes them, which allows the sites to load inside the sidebar iframe. Hence, my provider scripts are injected into the iframe via all_frames: true in the manifest.
MIT - see LICENSE. You can use, modify, and distribute this freely. Keep the copyright notice.
⭐ Developed by Ansh Dhariwal