Skip to content

Commit 6e124a2

Browse files
authored
Merge pull request #242 from smalruby/update-chrome-origin-trials
feat: update Chrome Origin Trials token
2 parents fb9250e + d1e66b2 commit 6e124a2

File tree

4 files changed

+47
-10
lines changed

4 files changed

+47
-10
lines changed

origin-trials.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"Serial": [
3+
{
4+
"origin": "smalruby.app",
5+
"matchSubdomains": false,
6+
"token": "Ag4uU2UqNmz2w+wQo7XPv6qzdHfjiLvzm//3JYQ8M7I+ro48rcE1BNq4uob+ayhLKF2VKjT6bsgToleYnAwWPwcAAABMeyJvcmlnaW4iOiJodHRwczovL3NtYWxydWJ5LmFwcDo0NDMiLCJmZWF0dXJlIjoiU2VyaWFsIiwiZXhwaXJ5IjoxNTk1MDMxMzQ3fQ==",
7+
"expiry": "2020-07-18"
8+
},
9+
{
10+
"origin": "smalruby.jp",
11+
"matchSubdomains": true,
12+
"token": "Ah/64l5f1XAfQJLzQwQPDxTe4V6zf3rVx8F8xmX+aEjOo+nmNJxmDygIzWvePkLHGzUefEyqFnFgZDckvn6LnQ0AAABeeyJvcmlnaW4iOiJodHRwczovL3NtYWxydWJ5LmpwOjQ0MyIsImZlYXR1cmUiOiJTZXJpYWwiLCJleHBpcnkiOjE1OTUwMzEyODUsImlzU3ViZG9tYWluIjp0cnVlfQ==",
13+
"expiry": "2020-07-18"
14+
}
15+
]
16+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smalruby3-gui",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "GraphicaL User Interface for creating and running Smalruby 3.0 projects",
55
"main": "./dist/smalruby3-gui.js",
66
"scripts": {

src/playground/index.ejs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,25 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<meta name="google" value="notranslate">
7-
<!-- https://.*smalruby.jp/ -->
8-
<meta http-equiv="origin-trial" content="AiLqvoNHKjujJ7wzrguiMyoRK9czxpxcOC39/sQAsoa+g0HomeeA5lhDHAnaXIBOY2huQnm0sYdH3I9GtTnRFAcAAABeeyJvcmlnaW4iOiJodHRwczovL3NtYWxydWJ5LmpwOjQ0MyIsImZlYXR1cmUiOiJTZXJpYWwiLCJleHBpcnkiOjE1OTE4MDg3NDQsImlzU3ViZG9tYWluIjp0cnVlfQ==">
9-
<!-- https://smalruby.app/ -->
10-
<meta http-equiv="origin-trial" content="ApPFZ7Y7tWtarih9JqeOUfGqbTka9l9KnJPLxUmuLSHJ44Y2FbZ2IXeZgV0KLFMRtBUqdgUWtSNV3jAMaFnZ0wIAAABMeyJvcmlnaW4iOiJodHRwczovL3NtYWxydWJ5LmFwcDo0NDMiLCJmZWF0dXJlIjoiU2VyaWFsIiwiZXhwaXJ5IjoxNTkxODA4ODIxfQ==">
7+
<%
8+
const originTrials = htmlWebpackPlugin.options.originTrials;
9+
if (originTrials) {
10+
%>
11+
<!-- Chrome Origin Trials: https://developers.chrome.com/origintrials -->
12+
<%
13+
Object.keys(originTrials).forEach(apiName => {
14+
%>
15+
<!-- <%= apiName %> API -->
16+
<%
17+
for (const info of originTrials[apiName]) {
18+
%>
19+
<!-- https://<%= info['matchSubdomains'] ? '.*' : '' %><%= info['origin'] %> -->
20+
<meta http-equiv="origin-trial" content="<%= info['token'] %>">
21+
<%
22+
}
23+
});
24+
}
25+
%>
1126
<link rel="shortcut icon" href="static/title.ico">
1227
<title><%= htmlWebpackPlugin.options.title %></title>
1328
<% if (htmlWebpackPlugin.options.sentryConfig) { %>

webpack.config.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const defaultsDeep = require('lodash.defaultsdeep');
22
var path = require('path');
33
var webpack = require('webpack');
4+
var fs = require('fs');
45

56
// Plugins
67
var CopyWebpackPlugin = require('copy-webpack-plugin');
@@ -144,32 +145,37 @@ module.exports = [
144145
chunks: ['lib.min', 'gui'],
145146
template: 'src/playground/index.ejs',
146147
title: 'Smalruby',
147-
sentryConfig: process.env.SENTRY_CONFIG ? '"' + process.env.SENTRY_CONFIG + '"' : null
148+
sentryConfig: process.env.SENTRY_CONFIG ? '"' + process.env.SENTRY_CONFIG + '"' : null,
149+
originTrials: JSON.parse(fs.readFileSync('origin-trials.json'))
148150
}),
149151
new HtmlWebpackPlugin({
150152
chunks: ['lib.min', 'gui'],
151153
template: 'src/playground/index.ejs',
152154
filename: 'ja.html',
153155
title: 'スモウルビー',
154-
sentryConfig: process.env.SENTRY_CONFIG ? '"' + process.env.SENTRY_CONFIG + '"' : null
156+
sentryConfig: process.env.SENTRY_CONFIG ? '"' + process.env.SENTRY_CONFIG + '"' : null,
157+
originTrials: JSON.parse(fs.readFileSync('origin-trials.json'))
155158
}),
156159
new HtmlWebpackPlugin({
157160
chunks: ['lib.min', 'blocksonly'],
158161
template: 'src/playground/index.ejs',
159162
filename: 'blocks-only.html',
160-
title: 'Smalruby 3.0 GUI: Blocks Only Example'
163+
title: 'Smalruby 3.0 GUI: Blocks Only Example',
164+
originTrials: JSON.parse(fs.readFileSync('origin-trials.json'))
161165
}),
162166
new HtmlWebpackPlugin({
163167
chunks: ['lib.min', 'compatibilitytesting'],
164168
template: 'src/playground/index.ejs',
165169
filename: 'compatibility-testing.html',
166-
title: 'Smalruby 3.0 GUI: Compatibility Testing'
170+
title: 'Smalruby 3.0 GUI: Compatibility Testing',
171+
originTrials: JSON.parse(fs.readFileSync('origin-trials.json'))
167172
}),
168173
new HtmlWebpackPlugin({
169174
chunks: ['lib.min', 'player'],
170175
template: 'src/playground/index.ejs',
171176
filename: 'player.html',
172-
title: 'Smalruby 3.0 GUI: Player Example'
177+
title: 'Smalruby 3.0 GUI: Player Example',
178+
originTrials: JSON.parse(fs.readFileSync('origin-trials.json'))
173179
}),
174180
new CopyWebpackPlugin([{
175181
from: 'static',

0 commit comments

Comments
 (0)