いまさらながら最強のTwitterクライアントを作り始めた
最強のTwitterクライアント作り始めた - 9mのパソコン日記
- 最近JavaScriptの案件も多いし勉強がてら作り始めた。
背景
やりたいこと
- 画像、動画のプレビュー
- Instagramのプレビュー
- electron & cordova対応
環境
- Electron + Node.js + Vue.js + OnsenUI2.0
- Vue.js:シンプルでわかりやすそうだったから。案件でBackbone.jsを使って疲弊したから
- OnsenUI:前々から使いたかったから。OnsenUI1系だとAngularJSとElectronの相性が悪くてうまく動かなかった。2.0はBetaだけどまあいいや
進捗
- そもそもJavaScript素人のためなかなか進まない
- マイペースにgithubに草を生やしていこうと思う
本タイトルは会員ランクがシルバー以上の方が視聴できます。
というメッセージが表示された。
続きを読むGoogle Cloud Messaging(GCM)はCross-Origin Resource Sharing(CORS)に対応してないらしい
Web Pushが動くデモサイトをhtmlとJavaScriptのみで作っていたら、Push時に以下のようなエラーになった。
Fetch API cannot load https://gcm-http.googleapis.com/gcm. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 405. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
どうやらGCMはクロスドメインに対応していないらしい。
PushはJavaScriptではなく別の仕組みを使わないといけないですね。
蛇足
FirefoxのWeb Pushサーバだとクロスドメインでも動く。