Skip to content

Commit 68b63a6

Browse files
committed
Add code
1 parent 9792e78 commit 68b63a6

12 files changed

+5074
-0
lines changed

.eslintrc.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
webextensions: true,
6+
},
7+
extends: [
8+
'airbnb-base',
9+
],
10+
parser: '@typescript-eslint/parser',
11+
parserOptions: {
12+
ecmaFeatures: {
13+
jsx: true,
14+
},
15+
ecmaVersion: 2018,
16+
sourceType: 'module',
17+
},
18+
plugins: [
19+
'@typescript-eslint',
20+
],
21+
rules: {
22+
'import/extensions': 'off',
23+
'linebreak-style': ['error', process.platform === 'win32' ? 'windows' : 'unix'],
24+
indent: 'off',
25+
'@typescript-eslint/indent': ['error', 2],
26+
27+
},
28+
settings: {
29+
'import/resolver': {
30+
node: {
31+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
32+
},
33+
},
34+
},
35+
ignorePatterns: ['extension'],
36+
};

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
Thumbs.db
3+
.vscode/
4+
extension/
5+
node_modules/
6+
helper.js

LICENSE

+674
Large diffs are not rendered by default.

build.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
2+
const esbuild = require('esbuild');
3+
const fs = require('fs-extra');
4+
const { version } = require('./package.json');
5+
6+
const OUTPUT_DIR = './extension';
7+
8+
const manifest = {
9+
manifest_version: 2,
10+
name: 'Bird Site Clown',
11+
version,
12+
description: 'Clownifies NFT bird site',
13+
permissions: ['<all_urls>'],
14+
browser_action: {
15+
default_popup: 'popup.html',
16+
},
17+
content_scripts: [
18+
{
19+
matches: ['<all_urls>'],
20+
js: ['content.js'],
21+
},
22+
],
23+
icons: {
24+
48: '48-icon.png',
25+
128: '128-icon.png',
26+
},
27+
};
28+
29+
const prepareContent = async () => {
30+
try {
31+
await fs.emptyDir(OUTPUT_DIR);
32+
await Promise.all([
33+
fs.writeFile(`${OUTPUT_DIR}/manifest.json`, JSON.stringify(manifest)),
34+
fs.copy('./extension_content', OUTPUT_DIR),
35+
esbuild.build({
36+
entryPoints: ['./src/content.ts'],
37+
bundle: true,
38+
minify: true,
39+
outfile: `${OUTPUT_DIR}/content.js`,
40+
plugins: [],
41+
}),
42+
]);
43+
} catch (err) {
44+
// eslint-disable-next-line no-console
45+
console.error(err);
46+
}
47+
};
48+
49+
prepareContent();

extension_content/128-icon.png

13 KB
Loading

extension_content/48-icon.png

4.95 KB
Loading

0 commit comments

Comments
 (0)