Skip to content

Commit

Permalink
Self-XSS attention message and Firefox add-on support by @
Browse files Browse the repository at this point in the history
sergeiivankov  toncenter#92
  • Loading branch information
tolya-yanot committed Mar 6, 2022
1 parent 1e16994 commit 17eecfe
Show file tree
Hide file tree
Showing 10 changed files with 445 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
node_modules
.env
build/
build-firefox/
build.tar
deploy.sh
deploy_plugin.sh
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijn

- Click "Load unpacked extension" and specify ton-wallet/build folder

# Mozilla Firefox Add-on Developer Mode

- Open Mozilla Firefox

- Go to about:debugging#/runtime/this-firefox

- Click "Load Temporary Add-on" and select ton-wallet/build-firefox/manifest.json file

# Build

`npm install`
Expand Down
31 changes: 26 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,42 @@ gulp.task('clean', function () {
return del(['build']);
});

gulp.task('clean-firefox', function () {
return del(['build-firefox']);
});

gulp.task('copy', function () {
return gulp.src([
'src/assets/**',
'src/libs/**',
'src/**/*.html',
'src/**/*.html'
], {base: 'src'})
.pipe(gulp.dest('build'))
.pipe(gulp.dest('build-firefox'));
});

gulp.task('copy-chrome', function () {
return gulp.src([
'src/js/extension/*',
'src/manifest.json'
], {base: 'src'})
.pipe(gulp.dest('build'));
});

gulp.task('copy-firefox', function () {
return gulp.src([
'src/firefox/contentscript.js',
'src/firefox/manifest.json',
], {base: 'src/firefox'})
.pipe(gulp.dest('build-firefox/'));
});

gulp.task('minify-css', function () {
return gulp.src('src/css/**/*.css')
.pipe(concatCss('main.css'))
.pipe(cssmin())
.pipe(gulp.dest('build/css'));
.pipe(gulp.dest('build/css'))
.pipe(gulp.dest('build-firefox/css'));
});

gulp.task('popup-html', function () {
Expand All @@ -37,9 +57,10 @@ gulp.task('popup-html', function () {
]
}))
.pipe(rename('popup.html'))
.pipe(gulp.dest('build'));
.pipe(gulp.dest('build'))
.pipe(gulp.dest('build-firefox'));
});

gulp.task('build', gulp.series('clean', 'copy', 'minify-css', 'popup-html'));
gulp.task('build', gulp.series('clean', 'clean-firefox', 'copy', 'copy-chrome', 'copy-firefox', 'minify-css', 'popup-html'));

gulp.task('default', gulp.series('clean', 'build'));
gulp.task('default', gulp.series('clean', 'clean-firefox', 'build'));
6 changes: 5 additions & 1 deletion src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,11 @@ button {
display: block;
}

.plugin #menu_extension {
.plugin #menu_extension_chrome {
display: none;
}

#menu_extension_firefox {
display: none;
}

Expand Down
Loading

0 comments on commit 17eecfe

Please sign in to comment.