Giter VIP home page Giter VIP logo

chrome-extension-google-slide-usertool-comment-stream's Introduction

Hi there, I'm swfz.

blog Twitter Follow GitHub followers

github stats GitHub Streak Contribution Stats

chrome-extension-google-slide-usertool-comment-stream's People

Contributors

dependabot[bot] avatar renovate[bot] avatar swfz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

chrome-extension-google-slide-usertool-comment-stream's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4.1.1
  • actions/setup-node v4.0.2
nodenv
.node-version
  • node 20.11.1
npm
package.json
  • react 18.2.0
  • react-dom 18.2.0
  • rollup-plugin-copy 3.5.0
  • @types/chrome 0.0.263
  • @types/node 20.11.30
  • @types/react 18.2.69
  • @types/react-dom 18.2.22
  • @vitejs/plugin-react 4.2.1
  • prettier 3.2.5
  • rollup-plugin-chrome-extension 4.0.1-25
  • typescript 5.4.3
  • vite 4.5.2

  • Check this box to trigger a request for Renovate to run again on this repository

Improvement

  • 縦横の比率
    • ちょっと歪んでるため適正にしたい

buildした成果物を読み込ませるとエラーが出て読み込めない

image

workarroundとしてビルドした成果物のmanifest.jsonを直接書き換え読み込める形に変更している

ok

  "web_accessible_resources": [
    {
      "matches": [
        "<all_urls>"
      ],
      "resources": [
        "assets/stream.ts.aff98a9b.js",
        "assets/subscribe.ts.7c33205d.js"
      ],
      "use_dynamic_url": true
    },

ng

  "web_accessible_resources": [
    {
      "matches": [
        "https://docs.google.com/presentation/d/*/edit"
      ],
      "resources": [
        "assets/stream.ts.aff98a9b.js"
      ],
      "use_dynamic_url": true
    },
    {
      "matches": [
        "https://docs.google.com/presentation/d/e/*"
      ],
      "resources": [
        "assets/subscribe.ts.7c33205d.js"
      ],
      "use_dynamic_url": true
    }
  ]

投稿からコメントが流れるまでラグがある

現象

発表者以外の質問コメントが発表者のユーザーツールに反映されるまでに結構時間が掛かる

そのため聞きたいことがありコメントしたとしてもコメントが流れたときには別の話題になっているなどの状況が多発する

仕組みと原因

2023-02-04時点

現在の仕組み

ユーザーツールのセッションを開始して発表者自身もコメントを入力できる画面で拡張を実行する

この画面のコメントのリストを購読して変化があったらコメント部分を取り出しスライド側に流すようにしている

ラグの原因

該当画面では

ユーザーツールの追加のコメントが有るかどうかのリクエストを定期的に送っている(10秒間隔)

これだけであれば誰かがコメントしたら最高10秒待てばコメントが流れてスライドにも流れると想定されたが

他のユーザーがコメントしたあと10秒たったあとでも上記リクエストのレスポンスに投稿したコメントが含まれないことが多々発生していた

このことからリクエスト先のサーバの状態やデータの状態のリアルタイム性がそこまでない状態だった

対応

プレゼンターのウィンドウでのユーザーツールでは発表者以外のコメントもほぼリアルタイムで反映されていたことを確認したのでそちら側で拡張を実行してコメントをsubscribeするように変更することで投稿から画面へ流れるまでのタイムラグを減らす

コメント流すツールのchrome拡張化

ブックマークレットで書いたものをChrome拡張へ移植する

ブックマークレットならcontent_scriptsにまず書けば移植はできる

機能

  • popupクリック時に発火させる(スライド、ユーザーツール)
  • 設定画面を作る(popup)
    • 文字色
    • フォント
    • 文字サイズ
    • 流れるスピード
    • 他設定できそうなもの
  • 特定文字列でエフェクト追加
    • 8888で拍手的な演出をいくつか用意
  • スタート時popupに表示
    • popupにステータス的なものを表示できれば理想

やること

  • content_scripts, popup, optionsそれぞれをTSで書いてコンパイルする、それをmanifestで読み込む
  • chromeの型ファイルを読んでVSCodeで判断してくれるようにする
  • dev環境用にローカルで再現できるHTMLを用意する
  • 2回読んだら2個流れてしまうのを対応

拍手

コメント内容が``888888` の場合にスライド右下に拍手っぽいアイコンが出てくるようにする
時間経過で透明になる

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.