Local blog for Japanese speaking developers
Chrome 61 ベータ版:JavaScript モジュール、デスクトップ版 Payment Request API、Web Share API、WebUSB
2017年8月31日木曜日
この記事は「型破りなモジュール使い」、Domenic Denicola による Chromium Blog の記事 "
Chrome 61 Beta: JavaScript modules, Payment Request API on desktop, Web Share API, and WebUSB
" を元に翻訳・加筆したものです。詳しくは元記事をご覧ください。
特に記載のない限り、下記の変更は Android、Chrome OS、Linux、Mac、Windows 向けの最新の Chrome
ベータ版
に適用されます。
JavaScript モジュール
モジュールを使うと、スクリプトの依存性を宣言できます。サードパーティ製ビルドツールでは、必須スクリプトのみをバンドルするためにモジュールを使用するのがすでに一般的です。 今回のリリースでは、
JavaScript モジュール
が新しい
<script type=module>
要素でネイティブ サポートされます。 ネイティブ サポートとは、ビルドのステップを経ずに、ブラウザが細かい単位で依存性を並列に取得し、キャッシュを活用してページ間の重複を防ぎ、正しい順序でのスクリプトの実行が保証されることを意味します。
導入にあたっては、
JavaScript モジュールの詳細
や、
モジュールの影響を受ける JavaScript 言語の機能について確認
してください。
デスクトップ版 Payment Request API
昨年
サポートが発表された Android 版
に続き、Windows、Mac、Linux、ChromeOS でも
Payment Request API
が利用できるようになります。デベロッパーは、プラットフォームを問わず安全でシームレスな購入手続きを提供できます。導入にあたっては、
統合ガイド
をご確認ください。
トランザクション全体における PaymentRequest プロセス
Web Share API
ユーザーがソーシャル ネットワークで簡単にコンテンツを共有できるようにするには、各ソーシャル サービス用の共有ボタンを手動でサイトに組み込む必要があります。そのため、ユーザーが実際に使っているサービスで共有できないことも多く、ページサイズの肥大化やサードパーティ製コードを含めることによるセキュリティ リスクも発生しています。
Chrome for Android では、新しく
navigator.share
API が利用できるようになっています。これは、Android ネイティブの共有ダイアログを呼び出すことにより、インストールされている任意のネイティブ アプリで簡単にテキストやリンクを共有できるようにするものです。今後のリリースでは、インストールされているウェブアプリとの共有もできるようになる予定です。
navigator.share API を使うと、Android ネイティブの共有ダイアログ経由でさまざまなネイティブ アプリとコンテンツの共有が可能
WebUSB
高レベルのウェブ プラットフォーム API は、キーボード、マウス、プリンター、ゲームパッドなど、ほとんどのハードウェア機器をサポートしています。しかし、特殊な教育、科学、産業用の USB 機器を使う場合は、安全ではない可能性があるドライバやソフトウェアを検索してシステムレベルの権限を使ってインストールする必要があります。
今回、Chrome で
WebUSB API
がサポートされました。これにより、ユーザーの同意を得た上で、ウェブアプリが機器と通信できるようになります。各デバイスが提供するすべての機能を利用できますが、ウェブのセキュリティが保証される点は変わりません。
今回のリリースに追加されたその他の機能
Android に加えて、PC でも
Network Information API
が利用できるようになりました。これを使うと、
サイト
から基盤となる端末の接続情報にアクセスできます。
既存の
Scroll API
の新しいオプション パラメータ、または
scroll-behavior
CSS プロパティ
を使って、スムーズなスクロールを指定できるようになりました。
プラットフォームで、CSSOM View
Smooth Scroll API
を使ってスムーズなネイティブ スクロールを実現できます。これには、
scroll-behavior: smooth
CSS プロパティまたは
window.scrollTo()
DOM スクロール メソッドを利用します。JavaScript でこの動作を実装する必要はなくなります。
CSS の色の値
は、
8 桁および 4 桁
の 16 進数を使って
#RRGGBBAA
および
#RGBA
という形式で指定するようになります。
Visual Viewport API
によって、サイトから相対位置で画面の内容にアクセスできるようになりました。これを使うと、ピンチしてズームなどの複雑な機能を直接的な方法で実現できます。
Device RAM API
を利用できるようになりました。サイトからユーザーの端末の RAM の量を参照できるようになるため、ウェブ アプリケーションの全体的なパフォーマンスを最適化できます。
インストールされたウェブアプリを操作して最初のウェブアプリのスコープ外のサイトに移動する場合、新しいサイトが自動的に
カスタム Chrome タブ
で読み込まれるようになりました。
ネイティブ コントロールを利用している動画の再生中に、ユーザーが動画と一致する向きに端末を回転すると、Chrome が自動的に
動画を全画面に拡大
するようになりました。
nextHopProtocol
が
Resource Timing
および
Navigation Timing
で利用できるようになりました。これにより、リソースの取得に利用する
ネットワーク プロトコル
にアクセスできるようになります。
サイトでサードパーティ製埋め込みコンテンツに
コンテンツ セキュリティ ポリシー
を強制できるようになりました。これには、
<iframe>
要素に新しく追加された
csp
属性
を使用します。
DOMTokenList
インターフェースで
replace()
がサポートされました。これにより、すべての同じトークンを簡単に新しいものに変更できます。たとえば、有効期限が切れた際に、
active
を
inactive
に変更できます。
要素の
attribute
名のリストにアクセスする
getAttributeNames()
がサポートされました。これにより、
attributes
コレクションに対して反復処理を行うよりも直接的な仕組みが提供されます。
セキュリティ強化のため、JavaScript ダイアログが開いた際に自動的に全画面を終了するようになります。
サイトから、指定されたオリジンや
quota
で使用されるディスク スペースの
大まかなバイト数にアクセス
できるようになりました。これには、
Storage API
に新しく追加された
navigator.storage.estimate()
関数を使用します。
ブラウザのキャッシュ ヒット率を上げるために、
URLSearchParams
で
sort()
がサポートされました。これは、格納されているすべての名前と値のペアを並び替えて出力します。
URLSearchParams
のコンストラクタが更新され、他の
URLSearchParams
インスタンスだけではなく、任意のオブジェクトをパラメータとして渡せるようになりました。
誤って発行された証明書を気づかずに使ってしまうことがないように、サイトで新しい
Expect-CT
HTTP ヘッダー
が使われるようになりました。これによって、レポートの自動化や Certificate Transparency 要件の強制が可能になります。
Chrome の
バックグラウンド タブ
で、Media Source による動画フレームのデコードが行われなくなりました。
ImageCapture.getPhotoSettings()
で、写真の解像度、赤目軽減、フラッシュ モードなどの
「ライブでない」カメラ設定
を取得できるようになります。
サイトは
Clear-Site-Data
ヘッダーを使って cookie や service worker、キャッシュエントリなどのクライアントサイドデータを削除できるようになります。
サポートの終了と相互運用性の改善
セキュリティ強化のため、URL に
\n
と
<
の両方の文字が含まれるリソースは
ブロック
されるようになります。
セキュリティ強化のため、安全でないコンテキストで
Presentation API
の
start
関数がサポートされなくなり、削除されました。
on<event>
属性間の一貫性を向上させるため、
onwheel
属性が
Element
から
Window
、
Document
、
HTMLElement
、
SVGElement
に移動します。
仕様に準拠し、さらに細かい参照コンテンツのフロー制御を実現するため、Chrome で 3 つの新しい
Referrer Policy
値である
same-origin
、
strict-origin
、
strict-origin-when-cross-origin
がサポートされました。
仕様の変更に従い、
colSpan
の最大値が 8190 から 1000 に下がりました。
Reviewed by
Eiji Kitamura - Developer Relations Team
ラベル
.app
1
.dev
1
#11WeeksOfAndroid
13
#11WeeksOfAndroid Android TV
1
#Android11
3
#DevFest16
1
#DevFest17
1
#DevFest18
1
#DevFest19
1
#DevFest20
1
#hack4jp
3
11 weeks of Android
2
A/B Testing
1
A4A
4
Accelerator
3
Accessibility
1
Actions on Google
16
Activation Atlas
1
Addy Osmani
1
ADK
2
AdMob
32
Ads
67
Ads API
68
Advanced Protection Program
3
AdWords API
16
Agency
1
AI
13
AIY
3
AIY Vision Kit
2
ALPN
1
AMP
116
AMP Cache
9
AMP Camp
2
AMP CSS
1
AMP Extension
1
AMP Fest
1
AMP for Email
4
AMP Optimizer
1
AMP Packager
1
AMP Playground
1
AMP Plugin
1
AMP SSR
1
AMP Story
4
AMP Toolbox
1
amp-bind
1
amp.dev
1
AMPHTML Ads
1
Analytics
9
Andorid
12
Android
395
Android 10
1
Android 11
20
Android 11 Compatibility
1
Android 11 final release
1
Android 11 meetups
1
Android 9
1
Android App Bundle
1
Android App Development
23
Android Architecture
1
Android Architecture Components
1
Android Auto
1
Android Design Support Library
1
Android Developer
14
Android Developer Story
4
Android Developers
13
Android Enterprise
6
Android for cars
2
Android Go
1
Android Jetpack
6
Android N
18
Android O
14
Android Open Source Project
1
Android P
7
Android Pay
1
android privacy
1
Android Q
13
android security
2
Android Security Year in Review
1
Android Studio
47
Android Studio 4.1
1
Android Support Library
6
Android Things
15
Android Tools
2
Android TV
11
Android Vitals
4
Android Wear
29
android11
6
androidmarket
3
androidstudio
1
AndroidX
6
Angular
2
Angular 2
2
AngularJS
2
Anthos
2
AoG
1
aosp
1
API
26
APIExpert
45
apk
2
APM
1
app
3
App Action
1
App Bundle
2
app engine
23
App Indexing
7
App Invites
6
App Maker
2
AppCompat
2
Apps Flutter eBay
1
Apps Script
11
aprilfool
4
AR
2
Architecture Components
7
ARCore
1
ArtTech
1
Associate Android Developer Certificate
1
Audio
7
Auth Code
1
Authentication
9
AuthSub
2
Autofill
5
AutoML
1
Autotrack
2
award
1
Awareness API
1
Beacons
6
bento
1
BERT
1
Best Practices
1
beta
2
Better Ads Standards
3
BigQuery
10
Billing
1
Biometrics
1
BLE
4
Blink
1
Blockly
1
blogger
1
BodyPix
1
Brillo
1
Brotli
2
Budou
1
Buildbetterapps
2
Calendar
3
campaign
1
Campus
1
Canvas
1
Cardboard
4
Career
1
Case Study
2
CCPA
1
CDS 2020
3
CDS Recap 2020
3
Certificate
2
chrome
192
Chrome Custom Tab
4
Chrome Dev Summit
5
chrome extension
14
Chrome for Android
2
Chrome for iOS
3
Chrome OS
7
Chrome Tech Talk Night
4
chrome90
1
Chromebook
4
Chromecast
7
chromewebstore
9
Chromium
7
CLI
1
ClientLogin
3
Closure Compiler
1
Cloud
25
Cloud AI Platform
2
Cloud Firestore
5
Cloud Functions
9
Cloud IoT Device SDK
1
Cloud Next
9
Cloud OnAir
3
Cloud OnBoard
4
Cloud PubSub
1
Cloud Storage
1
Cloud Study Jams
3
Cloud Summit
1
Cloud Test Lab
2
Cloudflare
1
CNN
1
Coalition for Better Ads
2
CocoaPods
1
code review
1
codejam
5
codelab
5
Codepen
1
Colaboratory
1
Common Criteria
1
Community
5
compatibility
1
Compose
1
compute engine
3
Contests
1
Context
1
controls
1
Conversation API
1
conversations
2
conversion
1
Cookie
10
Coral
3
COVID-19
2
Crash Reporting
2
Crashlytics
2
Custom Element
1
Custom Model
1
CWV
1
dark theme
1
Dart
2
DataCenter
1
Daydream
4
Deep Learning
4
Delegation
1
Demo Party
1
Design Patterns
1
Design Sprint
3
DesignBytes
1
Designer
1
DevArt
3
DevBytes
6
Developer
14
Developer Console
4
Developer Preview
6
Developer Relations
2
Developer Review
1
Developer Student Club
1
Developers Story
4
DevFest
10
DevFestX
3
DevOps
1
devtools
4
Dialogflow
1
Differential privacy
1
Digital Goods API
1
DirectShare
1
Discover
1
DNS-over-HTTPS
4
Domain
1
Doodle
1
DoubleClick
4
Doze モード
1
drive
2
DSC
1
DX
1
Dynamic Links
3
EarlGrey
1
Easter Egg
1
ECMAScript 2015
1
Eddystone
4
Edge
1
egypt
1
encoder
1
Encryption
1
English
2
Envoy
1
error
1
ES2015
1
ES2016
1
ES6
2
ES7
1
Event
6
Featured
25
FIDO
5
filter
1
final release
1
Firebase
120
Firebase Admin SDK
6
Firebase Analytics
10
Firebase Auth
4
Firebase Cloud Messaging
10
Firebase Crashlytics
2
Firebase Database
5
Firebase Libraries
1
Firebase Notifications
1
Firebase Performance
3
Firebase Remote Config
6
Flash
1
Flutter
6
Flutter App Development
1
font
3
fraud
1
G Suite
19
game
42
Game Developers Conference 2018
1
Game Developers Conference 2019
1
Gboard
1
GCP
17
GCPUG
1
GDC
1
GDD11JP
56
GDD2010JP
23
GDE
2
GDG
21
GDG Cloud
1
Geo
55
Gingerbread
1
GLIDE
5
Gmail
5
Gmail API
2
Go
1
golang
5
goo.gl
1
Google
7
Google Analytics
3
Google API
1
Google Apps
14
Google Apps Script
4
Google Assistant
10
Google Assistant SDK
2
Google Cast
8
Google Cloud
34
Google Cloud Day
4
Google Cloud INSIDE Digital
2
Google Cloud INSIDE Games & Apps
8
Google Cloud INSIDE Media
1
Google Cloud INSIDE Retail
3
Google Cloud Messaging
11
Google Cloud Platform
16
Google Code-in
1
Google Developer Experts
2
Google Developers Academy
1
Google Developers live
5
Google Developers Summit
2
Google Drive
6
Google Earth
1
Google Fit
2
Google for Games
2
Google for Mobile
2
Google for Startups
4
Google for Work
1
Google I/O
17
Google Impact Challenge
1
Google Maps
63
Google Maps Platform
51
Google ML Summit
2
Google Open Source Peer Bonus
1
Google Pay
4
Google Photo
1
Google Play
147
Google Play App Safety
1
Google Play Billing
1
Google Play Console
15
Google Play developer distribution agreement
1
Google Play Developer Policies
2
Google Play Game Services
10
Google Play Instant
1
Google Play Services
23
Google Play Store
1
Google Play アプリ署名
1
Google Plus
14
Google Search
7
Google Sheets API
3
Google Sign-In
12
Google Slides API
5
Google Summer of Code
1
Google Tag Manager
1
Google Trust Services
2
Google マップ
4
google_ads_api_v6
1
Google+
2
Googleapps
10
GoogleCloudDay
2
GoogleGames
1
GoogleI/O
28
GoogleLabs
1
GooglePlay
3
GoogleTV
1
GPS
1
Gradle
1
gRPC
2
GTUG
5
GWT
2
hack4jp
2
hackathon
7
handson
1
Hangouts Chat
2
Hosting
3
hotel
1
HTML5
17
HTML5Rocks
1
HTTP/2
5
HTTPS
14
I/O Extended
4
ID Token
1
Identity
15
Identity Toolkit
1
IGF2010
4
IGF2020
2
Ignite
4
IME
11
Indie Game
7
Indie Games Festival
7
Indie Games Festival 2018
2
Indie Games Festival 2019
12
Indie Games Festival 2020
7
Inevitable ja Night
30
Insights
1
Instagram
1
Instant Apps
6
intern
2
Invites
1
IO19
3
iOS
22
IoT
7
IPv6
1
Issue Tracker
2
IWD
1
Japanese
6
Japanese Developer
1
Japanese Input
1
JavaScript
11
Jetpack
5
Jetpack Compose
3
K-12
1
Key Transparency
1
Knowledge Graph
1
Kotlin
24
Kotlin Android Extensions
1
Kotlin Beginners
3
Kotlin Vocabulary
2
Kubernetes
2
l10n
8
latest
18
latest news
1
launch
1
LaunchPad
2
lifull
1
Lighthouse
1
LINE
1
Local AI
1
Location
1
Lollipop
10
Machine Learning
29
MAD Skills
2
MADSkills
2
Maker Faire Tokyo
1
Marshmallow
10
Material
1
Material Design
31
MDL
1
MDN
1
metrics
1
MIDI
2
mikan
1
Mixed Contents
4
ML
1
ML Kit
12
mlops
1
Mobile
15
Mobile Bootcamp
4
Mobile Sites certification
1
Mobile Vision
4
mod_pagespeed
1
Model Maker
1
monetization
2
monetize
3
Mozc
15
Music
1
NativeDriver
2
NativeScript
1
Navigation
1
NBU
1
ndk
3
Nearby
5
News
1
Next Extended
1
Next Tokyo
3
Nexus
2
Nexus S
1
NFC
1
Node.js
3
notifications
2
Noto CJK
1
Now in Android
13
NPAPI
2
NPN
1
oauth
12
open source
1
OpenAI
1
opencensus
1
OpenGL
4
OpenID
3
OpenID Connect
4
OpenSocial
1
opensource
18
OpenTitan
1
Optimization
1
Page Experience
1
Password Manager
3
Payment
8
Payment Handler API
1
Payment Request API
1
PDF
1
PEM
33
people
2
People API
3
Performance
15
Performance budget
1
permissions
1
PersonFinder
1
Physical Web
3
Pi
1
Pixel
2
Place Picker
1
Platform Stability
1
Play Billing
2
Play Billing Library
2
Play Console
2
Player Analytics
4
Playtime 2017
1
Policy
8
policy compliance
2
policy violations
2
Polymer
7
pricing
1
privacy
13
Privacy Sandbox
15
Progressive Web Apps
14
project hosting
1
Promise
1
Promo code
1
Protocol Buffers
1
PRPL
1
publicdata
1
Push API
1
Push Notification
6
PWA
3
Python
2
QUIC
2
QWIKLABS
3
RAIL
1
raspberry pi
1
React
1
React Native
2
Realtime Database
9
Recap Live Japan 2019
3
reCaptcha
1
Redux
1
release
3
Remote Config
3
Remote Display API
1
Requirements
1
Resonance Audio
1
Rewarded Video Ads
2
Runtime Permission
1
Safe Browsing
3
safety
1
Sample Code
2
Santa Tracker
1
schema.org
1
script
2
sdk
1
secur
1
security
74
Service Worker
4
SHA-1
1
sketchup
1
SmartLock for Passwords
4
social
4
Social Good
1
Social Media
1
software development
1
SPDY
3
speak2tweet
1
Spectre
2
Spreadsheet
3
SSR
1
stable release
1
startup
7
Storage
2
story
2
streetview
3
Study Jams
9
subscriptions
5
sunset
2
Swift
2
SwiftShader
1
Symantec
1
tag
1
tapple
1
Task
4
Team Drive
1
techtalk
13
TensorFlow
42
TensorFlow Federated
1
TensorFlow Lite
8
TensorFlow Object Detection API
1
TensorFlow Probability
2
TensorFlow.js
4
test
4
Test Lab
6
TF Certificate
2
TFX
1
TLS
1
ToS
1
trace
1
Transliteration
1
Trusted Web Activity
1
Twitter
1
Udacity
20
Unity
3
update
1
UX
5
v3
1
v6.1
1
V8
3
VP9
1
VR
11
Vulkan
2
Watch Face
2
wave
2
Wear OS
3
Weave
1
Web
34
Web Animations
1
Web Components
7
Web Manifest
1
Web Packaging
3
Web Stories
2
Web Story
3
Web Vitals
5
web.dev
1
WebAssembly
5
WebGL
1
WebM
1
WebMusic
5
WebRTC
1
WebView
1
Women Techmakers Scholars Program
1
Wordpress
1
workmanager
1
WTM
6
Xcode
1
YouTube
17
YouTube API
1
インタビュー
1
コードサンプル
1
プライバシー
1
機械学習
3
言論の自由
1
節電
3
定期購入
1
東日本大震災
9
日本語入力
41
ブログ アーカイブ
2021
4
3
2
1
2020
12
11
10
9
8
7
6
5
4
3
2
1
2019
12
11
10
9
8
7
6
5
4
3
2
1
2018
12
11
10
9
8
7
6
5
4
3
2
1
2017
12
11
10
9
8
7
6
5
4
3
2
1
2016
12
11
10
9
8
7
6
5
4
3
2
1
2015
12
11
10
9
8
7
6
5
4
3
2
2014
12
11
10
9
8
7
6
5
4
3
2
1
2013
12
11
10
9
8
7
6
5
4
3
2
1
2012
12
11
10
9
8
7
6
5
4
3
2
1
2011
12
11
10
9
8
7
6
5
4
3
2
1
2010
12
11
Feed
Follow @googledevjp
"プロダクトに関するご意見は
プロダクトフォーラム
にお願いします"