-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
executable file
·65 lines (58 loc) · 1.99 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* jshint node: true */
"use strict";
module.exports = {
name: "shared-goodcity",
isDevelopingAddon: function() {
return true;
},
included: function(app) {
this._super.included(app);
app.import("bower_components/font-awesome/css/font-awesome.css");
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.eot", {
destDir: "fonts"
});
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.svg", {
destDir: "fonts"
});
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.ttf", {
destDir: "fonts"
});
app.import("bower_components/font-awesome/fonts/fontawesome-webfont.woff", {
destDir: "fonts"
});
app.import(
"bower_components/font-awesome/fonts/fontawesome-webfont.woff2",
{ destDir: "fonts" }
);
app.import("bower_components/font-awesome/fonts/FontAwesome.otf", {
destDir: "fonts"
});
},
contentFor: function(type, config) {
if (type === "head-footer" && config.cordova.enabled) {
// add content security policy meta tag wanted by cordova-plugin-whitelist
// add winstore-jscompat.js for windows phone (not needed for Windows 10) https://github.com/MSOpenTech/winstore-jscompat
return (
'<meta http-equiv="Content-Security-Policy" content="' +
this.getContentPolicy(config) +
'">'
);
}
},
getContentPolicy: function(config) {
var cordovaPolicy = {
"frame-src": "gap:", // required by ios
"script-src": "'unsafe-eval'", // required by cordova.js
"connect-src": "https://dc.services.visualstudio.com" // required by testfairy
};
Object.keys(cordovaPolicy).forEach(function(key) {
config.contentSecurityPolicy[key] =
(config.contentSecurityPolicy[key] || "") + " " + cordovaPolicy[key];
});
return Object.keys(config.contentSecurityPolicy)
.map(function(key) {
return key + " " + config.contentSecurityPolicy[key];
})
.join("; ");
}
};