Skip to content

Commit c7a9abd

Browse files
committed
chore: format files and line endings
1 parent 3ef27c1 commit c7a9abd

29 files changed

+6423
-6395
lines changed

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.ts text
7+
*.js text

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
✅ By sending this pull request, I agree to the [Contributor License Agreement](https://github.com/samuelmaddock/electron-browser-shell#contributor-license-agreement) of this project.
1+
✅ By sending this pull request, I agree to the [Contributor License Agreement](https://github.com/samuelmaddock/electron-browser-shell#contributor-license-agreement) of this project.

README.md

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
# electron-browser-shell
2-
3-
A bare-bones, tabbed web browser with support for Chrome extensions—built on Electron.
4-
5-
This is a WIP testbed for development of Chrome extension support in Electron. Minimal dependencies are used as a means to allow developers to take what they need for their own projects.
6-
7-
![browser preview image showing 3 tabs and a youtube video](./screenshot.png)
8-
9-
## Usage
10-
11-
```bash
12-
# Get the code
13-
git clone [email protected]:samuelmaddock/electron-browser-shell.git
14-
cd electron-browser-shell
15-
16-
# Install and launch the browser
17-
yarn
18-
yarn start
19-
```
20-
21-
### Install extensions
22-
23-
Load unpacked extensions into `./extensions` then launch the browser.
24-
25-
## Roadmap
26-
27-
- [x] Browser tabs
28-
- [x] Unpacked extension loader
29-
- [x] Initial [`chrome.tabs` extensions API](https://developer.chrome.com/extensions/tabs)
30-
- [x] Initial [extension popup](https://developer.chrome.com/extensions/browserAction) support
31-
- [ ] Full support of [`chrome.*` extensions APIs](https://developer.chrome.com/extensions/devguide)
32-
- [ ] Robust extension popup support
33-
- [ ] Chrome webstore extension installer?
34-
35-
## Contributor license agreement
36-
37-
By sending a pull request, you hereby grant to owners and users of the
38-
electron-browser-shell project a perpetual, worldwide, non-exclusive,
39-
no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
40-
derivative works of, publicly display, publicly perform, sublicense, and
41-
distribute your contributions and such derivative works.
42-
43-
The owners of the electron-browser-shell project will also be granted the right to relicense the
44-
contributed source code and its derivative works.
1+
# electron-browser-shell
2+
3+
A bare-bones, tabbed web browser with support for Chrome extensions—built on Electron.
4+
5+
This is a WIP testbed for development of Chrome extension support in Electron. Minimal dependencies are used as a means to allow developers to take what they need for their own projects.
6+
7+
![browser preview image showing 3 tabs and a youtube video](./screenshot.png)
8+
9+
## Usage
10+
11+
```bash
12+
# Get the code
13+
git clone [email protected]:samuelmaddock/electron-browser-shell.git
14+
cd electron-browser-shell
15+
16+
# Install and launch the browser
17+
yarn
18+
yarn start
19+
```
20+
21+
### Install extensions
22+
23+
Load unpacked extensions into `./extensions` then launch the browser.
24+
25+
## Roadmap
26+
27+
- [x] Browser tabs
28+
- [x] Unpacked extension loader
29+
- [x] Initial [`chrome.tabs` extensions API](https://developer.chrome.com/extensions/tabs)
30+
- [x] Initial [extension popup](https://developer.chrome.com/extensions/browserAction) support
31+
- [ ] Full support of [`chrome.*` extensions APIs](https://developer.chrome.com/extensions/devguide)
32+
- [ ] Robust extension popup support
33+
- [ ] Chrome webstore extension installer?
34+
35+
## Contributor license agreement
36+
37+
By sending a pull request, you hereby grant to owners and users of the
38+
electron-browser-shell project a perpetual, worldwide, non-exclusive,
39+
no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
40+
derivative works of, publicly display, publicly perform, sublicense, and
41+
distribute your contributions and such derivative works.
42+
43+
The owners of the electron-browser-shell project will also be granted the right to relicense the
44+
contributed source code and its derivative works.

extensions/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Place unpacked extensions (not .crx archives) here to have them automatically loaded by the browser.
1+
Place unpacked extensions (not .crx archives) here to have them automatically loaded by the browser.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"printWidth": 100,
1919
"singleQuote": true,
2020
"jsonEnable": false,
21-
"semi": false
21+
"semi": false,
22+
"endOfLine": "lf"
2223
}
2324
}
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
{
2-
"name": "electron-chrome-extensions",
3-
"version": "1.0.0",
4-
"description": "Chrome extension support for Electron—built with tabbed browsers in mind.",
5-
"main": "dist/index.js",
6-
"scripts": {
7-
"build": "webpack"
8-
},
9-
"repository": "https://github.com/samuelmaddock/electron-browser-shell",
10-
"author": "Samuel Maddock <[email protected]>",
11-
"license": "GPL-3.0",
12-
"devDependencies": {
13-
"@babel/core": "^7.11.6",
14-
"@babel/plugin-proposal-class-properties": "^7.10.4",
15-
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
16-
"@babel/preset-env": "^7.11.5",
17-
"@babel/preset-typescript": "^7.10.4",
18-
"@types/chrome": "^0.0.122",
19-
"babel-loader": "^8.1.0",
20-
"electron": "^10.1.1",
21-
"typescript": "^4.0.2",
22-
"webpack": "^4.44.1",
23-
"webpack-cli": "^3.3.12"
24-
},
25-
"babel": {
26-
"presets": [
27-
[
28-
"@babel/preset-env",
29-
{
30-
"targets": {
31-
"electron": "10.1.0"
32-
}
33-
}
34-
],
35-
"@babel/preset-typescript"
36-
],
37-
"plugins": [
38-
"@babel/plugin-proposal-class-properties",
39-
"@babel/plugin-proposal-optional-chaining"
40-
]
41-
}
42-
}
1+
{
2+
"name": "electron-chrome-extensions",
3+
"version": "1.0.0",
4+
"description": "Chrome extension support for Electron—built with tabbed browsers in mind.",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"build": "webpack"
8+
},
9+
"repository": "https://github.com/samuelmaddock/electron-browser-shell",
10+
"author": "Samuel Maddock <[email protected]>",
11+
"license": "GPL-3.0",
12+
"devDependencies": {
13+
"@babel/core": "^7.11.6",
14+
"@babel/plugin-proposal-class-properties": "^7.10.4",
15+
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
16+
"@babel/preset-env": "^7.11.5",
17+
"@babel/preset-typescript": "^7.10.4",
18+
"@types/chrome": "^0.0.122",
19+
"babel-loader": "^8.1.0",
20+
"electron": "^10.1.1",
21+
"typescript": "^4.0.2",
22+
"webpack": "^4.44.1",
23+
"webpack-cli": "^3.3.12"
24+
},
25+
"babel": {
26+
"presets": [
27+
[
28+
"@babel/preset-env",
29+
{
30+
"targets": {
31+
"electron": "10.1.0"
32+
}
33+
}
34+
],
35+
"@babel/preset-typescript"
36+
],
37+
"plugins": [
38+
"@babel/plugin-proposal-class-properties",
39+
"@babel/plugin-proposal-optional-chaining"
40+
]
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
export class ExtensionAPIState {
2-
tabs = new Set<Electron.WebContents>()
3-
extensionHosts = new Set<Electron.WebContents>()
4-
5-
constructor(public session: Electron.Session) {}
6-
7-
sendToHosts(eventName: string, ...args: any[]) {
8-
this.extensionHosts.forEach((host) => {
9-
if (host.isDestroyed()) return
10-
host.send(eventName, ...args)
11-
})
12-
}
13-
14-
getTabById(tabId: number) {
15-
return Array.from(this.tabs).find((tab) => !tab.isDestroyed() && tab.id === tabId)
16-
}
17-
}
1+
export class ExtensionAPIState {
2+
tabs = new Set<Electron.WebContents>()
3+
extensionHosts = new Set<Electron.WebContents>()
4+
5+
constructor(public session: Electron.Session) {}
6+
7+
sendToHosts(eventName: string, ...args: any[]) {
8+
this.extensionHosts.forEach((host) => {
9+
if (host.isDestroyed()) return
10+
host.send(eventName, ...args)
11+
})
12+
}
13+
14+
getTabById(tabId: number) {
15+
return Array.from(this.tabs).find((tab) => !tab.isDestroyed() && tab.id === tabId)
16+
}
17+
}

0 commit comments

Comments
 (0)