Enable CSP by default
This commit is contained in:
parent
b4acbc0082
commit
ab5f85c63e
@ -67,10 +67,6 @@ Install [node.js](http://nodejs.org/) and run `node server.js`. Open page http:/
|
||||
#### Running as Chrome Packaged App
|
||||
|
||||
It is possible to run this application in Chrome browser as a packaged app. In order to do this, open this URL in Chrome: `chrome://extensions/`, then tick "Developer mode" and press "Load unpacked extension...". Select the downloaded `app` folder and Webogram application should appear in the list.
|
||||
Also it's necessary to replace following line in index.html:
|
||||
```<html lang="en" ng-app="myApp"><!-- ng-csp=""-->```
|
||||
with:
|
||||
```<html lang="en" ng-app="myApp" ng-csp="">```
|
||||
|
||||
|
||||
You can also download this application from Chrome Web Store: [chrome.google.com/webstore/detail/telegram-unofficial/clhhggbfdinjmjhajaheehoeibfljjno](https://chrome.google.com/webstore/detail/telegram-unofficial/clhhggbfdinjmjhajaheehoeibfljjno). This is more secure way to use app than plain HTTP in web, because sources are downloaded only once and via HTTPS.
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en" ng-app="myApp" manifest="webogram.appcache"><!-- ng-csp="" -->
|
||||
<html lang="en" ng-app="myApp" manifest="webogram.appcache" ng-csp="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
|
@ -62,7 +62,7 @@ gulp.task('copy', function() {
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('compress-dist', ['add-csp'], function() {
|
||||
gulp.task('compress-dist', function() {
|
||||
return gulp.src('**/*', {cwd: path.join(process.cwd(), '/dist')})
|
||||
.pipe($.zip('webogram_v' + pj.version + '.zip'))
|
||||
.pipe(gulp.dest('releases'));
|
||||
@ -72,12 +72,6 @@ gulp.task('cleanup-dist', ['compress-dist'], function() {
|
||||
return gulp.src(['releases/**/*', '!releases/*.zip']).pipe($.clean());
|
||||
});
|
||||
|
||||
gulp.task('add-csp', ['build'], function() {
|
||||
return gulp.src('dist/index.html')
|
||||
.pipe($.replace(/<html(.*?)>/, '<html$1 ng-csp="">'))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('update-version-manifests', function() {
|
||||
return gulp.src(['app/manifest.webapp', 'app/manifest.json'])
|
||||
.pipe($.replace(/"version": ".*",/, '"version": "' + pj.version + '",'))
|
||||
@ -177,7 +171,6 @@ gulp.task('package-dev', function() {
|
||||
.pipe(gulp.dest('dist_package/vendor')),
|
||||
|
||||
gulp.src('app/**/*.html')
|
||||
.pipe($.replace(/<html(.*?)>/, '<html$1 ng-csp="">'))
|
||||
.pipe($.replace(/PRODUCTION_ONLY_BEGIN/g, 'PRODUCTION_ONLY_BEGIN-->'))
|
||||
.pipe($.replace(/PRODUCTION_ONLY_END/, '<!--PRODUCTION_ONLY_END'))
|
||||
.pipe(gulp.dest('dist_package')),
|
||||
|
Loading…
x
Reference in New Issue
Block a user