How to use the chomex.Client function in chomex

To help you get started, we’ve selected a few chomex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github otiai10 / kanColleWidget / src / js / Applications / Components / Popup / IconMenu.tsx View on Github external
onClick: async () => {
        const res = await this.client.message("/options/open");
        console.log(res);
      },
    },
    {
      title: "編成キャプチャ",
      icon: "grip-vertical" as IconName,
      onClick: async () => {
        const res = await this.client.message("/deckcapture/open");
        console.log(res);
      },
    }
  ];

  private client: any /* FIXME: Client */ = new Client(chrome.runtime, false);

}
github otiai10 / kanColleWidget / src / js / Application / Views / Options / Simulator / index.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      kind:       "request",
      // controller: "onCombinedBattleResulted",
      controller: "onDeck",
      params:     {__this:{}},
      raw:        JSON.stringify({__this:{}}, null, 2),
      error:      null,
      output:     "",
    };
    this.client = new Client(chrome.runtime);
  }
  onParamsChanged(ev) {
github otiai10 / kanColleWidget / src / js / Application / Views / Stream / index.js View on Github external
constructor(props) {
    super(props);
    const url = new URL(location.href);
    this.state = {
            // プレー画面のキャプチャストリームURL
      capturedBlobURL: url.searchParams.get("src"),
            // STARTからSTOPまでの動画URL
      recordedBlobURL: null,
    };
    this.client = new Client(chrome.runtime);
    window.onbeforeunload = () => {
      this.client.message("/stream/revoke");
      return;
    };
    this.drawerWidth = 180;
  }
  startRecording() {
github otiai10 / kanColleWidget / src / js / Application / Views / Options / Winconfigs / WinconfigView.js View on Github external
updateFrame() {
    // TODO: バリデーションちゃんとしよう
    if (this.state.frame.alias.trim() == "") return window.alert("名前は必須です");
    const client = new Client(chrome.runtime);
    client.message("/frame/update", {frame: this.state.frame.regulate()}).then(() => location.reload());
  }
}
github otiai10 / kanColleWidget / src / js / Applications / Components / Options / Debugger / Simulator.vue View on Github external
constructor() {
    super();
    this.client = new Client(chrome.runtime, false);
    this.client.message("/debug/availables", (res) => {
      this.controllers.message = res.data.controllers.message;
      this.controllers.request = res.data.controllers.request;
      this.$forceUpdate(); // FIXME:
    });
  }
github otiai10 / kanColleWidget / src / js / Applications / Components / Popup / LaunchTrigger.tsx View on Github external
import React, { Component, Fragment } from "react";
import {Client} from "chomex";
import Frame from "../../Models/Frame";

export default class LaunchTrigger extends Component<{}, {frames: Frame[], selected: Frame}> {
  private client: Client = new Client(chrome.runtime);
  constructor(props) {
    super(props);
    this.state = {
      frames: Frame.list(),
      selected: Frame.latest(),
    };
  }
  render() {
    return (
      <div>
        <div>
          <div>
            <select> this.onSelect(ev)}
              className="form-select"
              style={{appearance: "none"}}</select></div></div></div>
github otiai10 / kanColleWidget / src / js / Applications / Components / Popup / LaunchTrigger.vue View on Github external
constructor() {
    super();
    this.client = new chomex.Client(chrome.runtime);
    this.frames = Frame.list();
    this.selected = Frame.latest();
  }
github otiai10 / kanColleWidget / src / js / Applications / Components / DamageSnapshot / index.tsx View on Github external
import React, { Component } from "react";

import { Client } from "chomex";
import TempStorage from "../../../Services/TempStorage";


export default class DamageSnapshot extends Component&lt;{}, {
  count: number;
  text?: string;
  uris: string[];
}&gt; {

  private client: any = new Client(chrome.runtime);
  private observe: number;
  private record: number;
  private key: string;

  constructor(props) {
    super(props);
    const search = new URLSearchParams(location.search);
    const count = parseInt(search.get("count") || "1");
    const text = search.get("text");
    this.key = search.get("key");
    this.observe = setInterval(() =&gt; this.renderImage(), 100);
    this.record  = setInterval(() =&gt; this.recordFrame(),  2000);
    this.state = {count, text, uris: []};
  }
  render() {
    const {text, uris} = this.state;
github otiai10 / kanColleWidget / src / js / Application / Views / ManualTimer / index.js View on Github external
constructor(props) {
    super(props);
    this.params = (new URL(location.href)).searchParams;
    window.document.querySelector("title").innerHTML = `${this.title()}タイマー手動登録`;
    this.queue = {
      type: this.params.get("type"),
      identifier: this.params.get("identifier"),
    };
    this.client = new Client(chrome.runtime);
  }
  title() {

chomex

Chrome Extension Routing Kit

MIT
Latest version published 4 years ago

Package Health Score

50 / 100
Full package analysis

Popular chomex functions