├── .github
├── FUNDING.yml
└── workflows
│ └── staml.yaml
├── .gitattributes
├── misc
├── chrome.png
├── bing.afphoto
├── firefox.png
├── chrome-download.png
└── firefox-download.png
├── public
├── favicon.ico
├── icon128.png
├── icon16.png
├── icon192.png
├── icon32.png
├── icon512.png
├── icon1024.png
├── popup.html
├── firefox.json
├── chrome.json
└── rules.json
├── release
├── chrome.zip
└── firefox.zip
├── jest.config.js
├── .prettierrc
├── README.md
├── tsconfig.json
├── rules.json
├── install.md
├── webpack
├── webpack.chrome.js
├── webpack.firefox.js
└── webpack.common.js
├── LICENSE
├── uninstall.md
├── package.json
├── .gitignore
└── src
├── background.ts
└── popup.tsx
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: anaclumos
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | webpack/*.js linguist-language=TypeScript
2 |
--------------------------------------------------------------------------------
/misc/chrome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/misc/chrome.png
--------------------------------------------------------------------------------
/misc/bing.afphoto:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/misc/bing.afphoto
--------------------------------------------------------------------------------
/misc/firefox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/misc/firefox.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon128.png
--------------------------------------------------------------------------------
/public/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon16.png
--------------------------------------------------------------------------------
/public/icon192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon192.png
--------------------------------------------------------------------------------
/public/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon32.png
--------------------------------------------------------------------------------
/public/icon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon512.png
--------------------------------------------------------------------------------
/release/chrome.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/release/chrome.zip
--------------------------------------------------------------------------------
/public/icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/public/icon1024.png
--------------------------------------------------------------------------------
/release/firefox.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/release/firefox.zip
--------------------------------------------------------------------------------
/misc/chrome-download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/misc/chrome-download.png
--------------------------------------------------------------------------------
/misc/firefox-download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anaclumos/bing-chat-for-all-browsers/HEAD/misc/firefox-download.png
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | roots: ['src'],
3 | transform: {
4 | '^.+\\.ts$': 'ts-jest',
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": false,
3 | "singleQuote": true,
4 | "arrowParens": "always",
5 | "tabWidth": 2,
6 | "useTabs": false,
7 | "printWidth": 120,
8 | "trailingComma": "es5",
9 | "endOfLine": "lf",
10 | "bracketSpacing": true
11 | }
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Bing Chat for All Browsers
4 |
5 | > **Warning**
I am shutting down the extension. https://github.com/anaclumos/bing-chat-for-all-browsers/issues/119
6 |
7 |
--------------------------------------------------------------------------------
/public/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bing-chat-for-all-browsers",
3 | "version": "1.0.7",
4 | "description": "bing-chat-for-all-browsers",
5 | "main": "index.js",
6 | "scripts": {
7 | "watch": "webpack --config webpack/webpack.dev.js --watch",
8 | "build": "$npm_execpath run clean && $npm_execpath run chrome && $npm_execpath run firefox",
9 | "chrome": "webpack --config webpack/webpack.chrome.js",
10 | "firefox": "webpack --config webpack/webpack.firefox.js",
11 | "safari": "xcrun safari-web-extension-converter release/firefox --swift --no-open --copy-resources --project-location safari --force --bundle-identifier sh.cho.bing-chat-for-all-browsers",
12 | "clean": "rimraf release",
13 | "test": "npx jest",
14 | "style": "prettier --write \"**/*.{ts,tsx,json,js,jsx,css,scss,html,md}\"",
15 | "zip": "cd release && rm -f chrome.zip && rm -f firefox.zip && cd chrome && zip -r ../chrome.zip -m .DS_Store * && cd ../firefox && zip -r ../firefox.zip -m .DS_Store * && cd .. && rm -rf chrome && rm -rf firefox"
16 | },
17 | "author": "",
18 | "license": "MIT",
19 | "repository": {
20 | "type": "git",
21 | "url": "https://github.com/anaclumos/bing-chat-for-all-browsers.git"
22 | },
23 | "dependencies": {
24 | "react": "^17.0.1",
25 | "react-dom": "^17.0.1",
26 | "webextension-polyfill-ts": "^0.26.0"
27 | },
28 | "devDependencies": {
29 | "@types/chrome": "0.0.158",
30 | "@types/jest": "^27.0.2",
31 | "@types/react": "^17.0.0",
32 | "@types/react-dom": "^17.0.0",
33 | "copy-webpack-plugin": "^9.0.1",
34 | "file-loader": "^6.2.0",
35 | "glob": "^7.1.6",
36 | "jest": "^27.2.1",
37 | "prettier": "^2.2.1",
38 | "rimraf": "^3.0.2 ",
39 | "ts-jest": "^27.0.5",
40 | "ts-loader": "^8.0.0",
41 | "typescript": "^4.4.3 ",
42 | "url-loader": "^4.1.1",
43 | "webpack": "^5.61.0",
44 | "webpack-cli": "^4.0.0",
45 | "webpack-merge": "^5.0.0"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/public/rules.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "priority": 1,
5 | "action": {
6 | "type": "modifyHeaders",
7 | "requestHeaders": [
8 | {
9 | "header": "User-Agent",
10 | "operation": "set",
11 | "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
12 | },
13 | {
14 | "header": "useragentreductionoptout",
15 | "operation": "set",
16 | "value": "A7kgTC5xdZ2WIVGZEfb1hUoNuvjzOZX3VIV/BA6C18kQOOF50Q0D3oWoAm49k3BQImkujKILc7JmPysWk3CSjwUAAACMeyJvcmlnaW4iOiJodHRwczovL3d3dy5iaW5nLmNvbTo0NDMiLCJmZWF0dXJlIjoiU2VuZEZ1bGxVc2VyQWdlbnRBZnRlclJlZHVjdGlvbiIsImV4cGlyeSI6MTY4NDg4NjM5OSwiaXNTdWJkb21haW4iOnRydWUsImlzVGhpcmRQYXJ0eSI6dHJ1ZX0="
17 | },
18 | {
19 | "header": "Sec-CH-UA",
20 | "operation": "set",
21 | "value": "\"Chromium\";v=\"112\", \"Microsoft Edge\";v=\"112\", \"Not:A-Brand\";v=\"99\""
22 | },
23 | {
24 | "header": "Sec-CH-UA-Arch",
25 | "operation": "set",
26 | "value": "x86"
27 | },
28 | {
29 | "header": "Sec-CH-UA-Bitness",
30 | "operation": "set",
31 | "value": "64"
32 | },
33 | {
34 | "header": "Sec-CH-UA-Full-Version",
35 | "operation": "set",
36 | "value": "112.0.1722.48"
37 | },
38 | {
39 | "header": "Sec-CH-UA-Full-Version-List",
40 | "operation": "set",
41 | "value": "\"Chromium\";v=\"112.0.5615.121\", \"Microsoft Edge\";v=\"112.0.1722.48\", \"Not:A-Brand\";v=\"99.0.0.0\""
42 | },
43 | {
44 | "header": "Sec-MS-GEC-Version",
45 | "operation": "set",
46 | "value": "1-112.0.1722.48"
47 | }
48 | ]
49 | },
50 | "condition": {
51 | "regexFilter": ".*bing.com.*",
52 | "resourceTypes": ["main_frame"]
53 | }
54 | }
55 | ]
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 | .pnpm-debug.log*
9 |
10 | # Diagnostic reports (https://nodejs.org/api/report.html)
11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12 |
13 | # Runtime data
14 | pids
15 | *.pid
16 | *.seed
17 | *.pid.lock
18 |
19 | # Directory for instrumented libs generated by jscoverage/JSCover
20 | lib-cov
21 |
22 | # Coverage directory used by tools like istanbul
23 | coverage
24 | *.lcov
25 |
26 | # nyc test coverage
27 | .nyc_output
28 |
29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30 | .grunt
31 |
32 | # Bower dependency directory (https://bower.io/)
33 | bower_components
34 |
35 | # node-waf configuration
36 | .lock-wscript
37 |
38 | # Compiled binary addons (https://nodejs.org/api/addons.html)
39 | build/Release
40 |
41 | # Dependency directories
42 | node_modules/
43 | jspm_packages/
44 |
45 | # Snowpack dependency directory (https://snowpack.dev/)
46 | web_modules/
47 |
48 | # TypeScript cache
49 | *.tsbuildinfo
50 |
51 | # Optional npm cache directory
52 | .npm
53 |
54 | # Optional eslint cache
55 | .eslintcache
56 |
57 | # Optional stylelint cache
58 | .stylelintcache
59 |
60 | # Microbundle cache
61 | .rpt2_cache/
62 | .rts2_cache_cjs/
63 | .rts2_cache_es/
64 | .rts2_cache_umd/
65 |
66 | # Optional REPL history
67 | .node_repl_history
68 |
69 | # Output of 'npm pack'
70 | *.tgz
71 |
72 | # Yarn Integrity file
73 | .yarn-integrity
74 |
75 | # dotenv environment variable files
76 | .env
77 | .env.development.local
78 | .env.test.local
79 | .env.production.local
80 | .env.local
81 |
82 | # parcel-bundler cache (https://parceljs.org/)
83 | .cache
84 | .parcel-cache
85 |
86 | # Next.js build output
87 | .next
88 | out
89 |
90 | # Nuxt.js build / generate output
91 | .nuxt
92 | dist
93 |
94 | # Gatsby files
95 | .cache/
96 | # Comment in the public line in if your project uses Gatsby and not Next.js
97 | # https://nextjs.org/blog/next-9-1#public-directory-support
98 | # public
99 |
100 | # vuepress build output
101 | .vuepress/dist
102 |
103 | # vuepress v2.x temp and cache directory
104 | .temp
105 | .cache
106 |
107 | # Docusaurus cache and generated files
108 | .docusaurus
109 |
110 | # Serverless directories
111 | .serverless/
112 |
113 | # FuseBox cache
114 | .fusebox/
115 |
116 | # DynamoDB Local files
117 | .dynamodb/
118 |
119 | # TernJS port file
120 | .tern-port
121 |
122 | # Stores VSCode versions used for testing VSCode extensions
123 | .vscode-test
124 |
125 | # yarn v2
126 | .yarn/cache
127 | .yarn/unplugged
128 | .yarn/build-state.yml
129 | .yarn/install-state.gz
130 | .pnp.*
131 |
--------------------------------------------------------------------------------
/src/background.ts:
--------------------------------------------------------------------------------
1 | // ** How this works ** //
2 | /*
3 | Microsoft Bing checks if the user agent is a represents a Chromium Browser (as Microsoft Edge is based on Chromium),
4 | then it checks if it is the Microsoft Edge Browser by using the suffix Microsoft Bing adds to the user agent to enable Bing Chat.
5 |
6 | This limitation of Bing Chat to only Microsoft Edge users is a synthetic limitation, as it is possible to spoof the user agent to make Bing Chat work on other browsers.
7 |
8 | On Chrome (and other chromium based browsers): it will simply append the Microsoft Edge useragent suffix to the user agent
9 | On Firefox it will replace the entire user agent with a hard coded Chrome user agent with the Microsoft Edge useragent suffix appended to it.
10 | */
11 |
12 | declare var firefox: boolean | undefined;
13 |
14 | //Microsoft Edge has two user agent suffixes, one for mobile and one for desktop
15 | const MOBILE_UA_SUFFIX = 'EdgA/42.0.0.2057'
16 | const DESKTOP_UA_SUFFIX = 'Edg/112.0.1722.48'
17 |
18 | const DESKTOP_UA_PREFIX =
19 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
20 | const MOBILE_UA_PREFIX =
21 | 'Mozilla/5.0 (Linux; Android 8.1.0; Pixel Build/OPM4.171019.021.D1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36'
22 |
23 | //formulate the UserAgent
24 | const uaMaker = (isMobile: boolean): string => {
25 | if (firefox) {
26 | //on Firefox, we replace the entire user agent with a hard coded Chrome user agent with the Microsoft Edge useragent suffix appended to it.
27 | if (isMobile) {
28 | return `${MOBILE_UA_PREFIX} ${MOBILE_UA_SUFFIX}`
29 | }
30 | }
31 | return `${DESKTOP_UA_PREFIX} ${DESKTOP_UA_SUFFIX}`
32 | }
33 |
34 |
35 | chrome.webRequest.onBeforeSendHeaders.addListener((details) => {
36 | const { requestHeaders } = details
37 |
38 | if (!requestHeaders)
39 | return undefined
40 |
41 | const newHeaders = requestHeaders.map((header) => {
42 | if (header.name.toLowerCase() === 'user-agent') {
43 | const isMobile: boolean = header.value?.toLowerCase().includes('mobile') ?? false;
44 | header.value = uaMaker(isMobile);
45 | }
46 | return header
47 | })
48 | return { requestHeaders: newHeaders }
49 | },
50 | { urls: ['*://*.bing.com/*'] },
51 | ['blocking', 'requestHeaders']
52 | );
53 |
54 | chrome.runtime.onInstalled.addListener((object) => {
55 | let install = 'http://github.com/anaclumos/bing-chat-for-all-browsers/tree/main/install.md'
56 | if (object.reason.toLowerCase().includes('install')) {
57 | chrome.tabs.create({ url: install })
58 | }
59 | })
60 |
61 | chrome.runtime.setUninstallURL('http://github.com/anaclumos/bing-chat-for-all-browsers/tree/main/uninstall.md')
62 |
--------------------------------------------------------------------------------
/src/popup.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | // @ts-ignore
4 | import BingIcon from '../public/icon1024.png'
5 |
6 | const Popup = () => {
7 | return (
8 | <>
9 | {
12 | chrome.tabs.create({
13 | url: 'https://bing.com/chat',
14 | })
15 | }}
16 | >
17 |
47 | Leave me a review for{' '}
48 | {
51 | chrome.tabs.create({
52 | url:
53 | 'https://chrome.google.com/webstore/detail/bing-chat-for-all-browser/jofbglonpbndadajbafmmaklbfbkggpo',
54 | })
55 | }}
56 | >
57 | Chrome
58 | {' '}
59 | or{' '}
60 | {
63 | chrome.tabs.create({
64 | url: 'https://addons.mozilla.org/en-US/firefox/addon/bing-chat-for-all-browsers/',
65 | })
66 | }}
67 | >
68 | Firefox
69 |
70 | .
71 |
72 | Please check out{' '}
73 | {
76 | chrome.tabs.create({
77 | url: 'https://hn.cho.sh/?ref=bingchat&utm_source=bingchat&utm_medium=extension&utm_campaign=bingchat',
78 | })
79 | }}
80 | >
81 | Oneliner News
82 | {' '}
83 | — my newsletter AI that reads 3M+ words a day and gives you an one-liner explanation.
84 |
85 |
86 | Solution for common problems. Clear Cache and Cookies on Bing. Disable VPN or Adblock on Bing.
87 | Make sure you are logged-in with Microsoft account with Bing Chat enabled. If you still have problems,{' '}
88 | {
91 | chrome.tabs.create({
92 | url: 'https://github.com/anaclumos/bing-chat-for-all-browsers',
93 | })
94 | }}
95 | >
96 | Let me know on GitHub
97 |
98 | {'. '}
99 |