{"id":16683618,"url":"https://github.com/yamachu/kancolleviewertemplate","last_synced_at":"2025-06-12T07:08:44.312Z","repository":{"id":79718982,"uuid":"145142192","full_name":"yamachu/KanColleViewerTemplate","owner":"yamachu","description":"Electronで艦これの専ブラを作りたくなった時のテンプレートプロジェクト","archived":false,"fork":false,"pushed_at":"2018-08-18T06:02:29.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T12:32:33.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yamachu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-17T16:17:39.000Z","updated_at":"2018-08-18T06:02:31.000Z","dependencies_parsed_at":"2023-03-08T01:15:46.964Z","dependency_job_id":null,"html_url":"https://github.com/yamachu/KanColleViewerTemplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yamachu/KanColleViewerTemplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FKanColleViewerTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FKanColleViewerTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FKanColleViewerTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FKanColleViewerTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamachu","download_url":"https://codeload.github.com/yamachu/KanColleViewerTemplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamachu%2FKanColleViewerTemplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259418187,"owners_count":22854184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T14:25:33.873Z","updated_at":"2025-06-12T07:08:44.303Z","avatar_url":"https://github.com/yamachu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KanColleViewerTemplate\nElectronで艦これの専ブラを作りたくなった時のテンプレートプロジェクト\n\n## 使い方\n\n### セットアップ\n\n```shell\n$ npm install\n# or\n$ yarn install\n```\n\n### 起動\n\n```shell\n$ npm run start\n# or\n$ yarn run start\n```\n\n### レスポンスの受け取り方\n\n`window.game.jsonResponse` が _RxJS_ の _Subject_ になっているので、いい感じにsubscribeする。\n\n流れてくるObjectは\n\n```json\n{\n  URL: string,\n  Body: string\n}\n```\n\nの形式になっている。\n\nAPIによってはBodyがundefinedの場合もあるため、`response.Body.slice(7)` みたいな形で受け取ろうとするとundefinedを踏んでしまい問題が生じる。\n適宜Bodyがundefinedか値があるかの確認を行うこと。\n\n適当に試したい場合はDeveloper Toolsを開いて\n\n```js\nwindow.game.jsonResponse.subscribe((v) =\u003e {\n  if (v.Body !=== undefined) {\n    // 文字列だけだとわからんな\n    // console.log(`URL: ${v.URL}, Body: ${v.Body.slice(7)}`);\n    console.log(`URL: ${v.URL}`);\n    console.log(JSON.parse(v.Body.slice(7)));\n  }\n});\n```\n\nとかを叩いてみるといいかもしれない。\n\n## ちょっとした説明\n\n本アプリケーションではChrome Debugging Protocolを使用して、Networkの監視を行っている。\nコードとしては[こんな感じ](https://github.com/yamachu/KanColleViewerTemplate/blob/master/src/js/requestHandler.js#L18)でいい感じに受け取ることが出来る。\nChrome Debugging Protocolのドキュメントについては各自参照されたし。\n\nそこで得られたイベントをレンダラプロセスのWindowオブジェクトに定義したSubjectに流し込んでいる。\nそのためレンダラプロセスでそのイベントに応じていい感じのUIが作れる __かも__ しれない。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamachu%2Fkancolleviewertemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamachu%2Fkancolleviewertemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamachu%2Fkancolleviewertemplate/lists"}