Code Monkey home page Code Monkey logo

cockpit-for-pixiv's People

Contributors

8th713 avatar dependabot[bot] avatar hogewest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cockpit-for-pixiv's Issues

画像に合わせてスクロールするショートカット

fork で実装されている。

  • 現在表示されている画像を保持しなければならなくなる。

    • 少しでも手動スクロールしたら即 unset vs 手動スクロールに追従して更新?
  • 手動スクロールに追従する場合 fit mode によって振る舞いがかわる

  • 画面に対して著しく小さい画像でも振る舞いを変える必要がある。

  • 見開きモードかどうかでも変える必要あり。

動かないページを報告する

cockpit for pixiv が動作しないリンクがあるページを見つけたら報告する場所です。
GitHub アカウントがない場合 Twitter やメールでの報告でも大丈夫です。
以下のテンプレートを利用してください。

* cockpit for pixiv のバージョン: v2.x.x
* Tampermonkey のバージョン: v4.x
* 動かないリンクが含まれるページのURL
  * あれば補足情報(セレクター情報や具体的な説明など)

pixiv にはいろいろなページがありサムネイルリンクのマークアップに統一性がありません。
ひとりですべてのリンクを確認するのは難しいです。

全てのページで動かなくなった場合は新しく Issue を開いてください。

セレクタの変更に弱すぎ問題

問題点:
pixiv は styled-components や css modules を使っているので CSS セレクタが頻繁に変更される。CSS セレクタが変更されると起動トリガーとなるサムネイルリンクが検出できなくなる。

望ましい動作:
pixiv の CSS セレクタが変更されてもサムネイルリンクが検出できる。

解決策:

  • リンク先が個別イラストページ(/member_illust.php?mode=medium&illust_id=xxx)のアンカータグがターゲットなので属性セレクタa[href*="member_illust.php?mode=medium&illust_id="]を使う。
  • ただしこの方法はテキストリンクも拾ってしまうため何らかの手段でテキストリンクを除外する必要がある。
  • ターゲットをマウスオーバーしたときカーソルを変更する必要があるためテキストリンクの除外も CSS セレクタで表現しなければならない。
  • 上記要求を満たすにはどうしても pixiv の CSS セレクタに依存する必要がありすると変更に弱くなる。
  • ただしターゲット検出漏れ(つまり動作しない)よりも除外漏れ(つまり余計な場所でも動作してしまう)のほうがエンドユーザーには優しいので検討の価値がある。

アーキテクチャ再考

  • New pixiv API ベースデータモデル
    • 内部 API をドキュメントにまとめたい
  • 脱 MobX
    • Suspense を見越した仕組み
  • 画像に合わせてスクロールするモデル #22
  • @grant none を諦める #8

cockpit for pixivが起動しない

 サイトの紹介通りにインストールするも、どうにも起動しないので報告を。
 普段はSRWare IronというGoogle Chromeの派生ブラウザを使用しているため相性かと思いChrome、Firefox両方で試みて見るも結果は同じく。
 Ironのほうで要素検証を眺めてみたところこのようなエラー表示が出ていたので、参考までにペーストしておきます。
 
ERROR: Execution of script 'cockpit for pixiv' failed! Cannot read property 'UgokuIllustPlayer' of undefined(program):2359 (anonymous function)
(program):2359 TypeError: Cannot read property 'UgokuIllustPlayer' of undefined
at Object.36../../../../../../services/http.js (eval at (eval at (unknown source)), :744:37)
at s (eval at (eval at (unknown source)), :20:254)
at eval (eval at (eval at (unknown source)), :20:305)
at Object.40../components/comic (eval at (eval at (unknown source)), :906:12)
at s (eval at (eval at (unknown source)), :20:254)
at eval (eval at (eval at (unknown source)), :20:305)
at Object.43../../services/api.js (eval at (eval at (unknown source)), :1012:11)
at s (eval at (eval at (unknown source)), :20:254)
at eval (eval at (eval at (unknown source)), :20:305)
at Object.1../app (eval at (eval at (unknown source)), :28:11)

 参考までに環境はwindows7 64bit、Intel(R) Pentium(R) CPU B950 @2.10GHz メモリ4.00GBです。

画像保存できません

ショートカット「D」で画像が保存できると思うのですが、「サーバーに問題が発生しました。」と表示されて失敗してしまいます。私の環境が悪いのでしょう?他は特に問題もなく…

作品データが取得できない

現象

  • 情報パネルの内容が取得/表示できない。

原因

  • 作品詳細ページがクライント側で動的にレンダリングされる使用に変更された。

修正

  • 新たな内部APIからスクレイピングで得ていた情報を取得する。

ダウンロード時のファイル名が反映されない

現状では対処方法が思いつかない。

原因:

  • GM_xmlhttpRequest で blob を取得することはできない。
  • responseText => data URL 変換は頑張れば可能だが pixiv にアップされた画像はサイズがすごいので処理時間がすごいかかる。というか途中で Chrome が音を上げて処理をやめてしまう。

提案:

  • 画像を iframe で開いてそのページに対して実行される userScript を作る。
  • このやりかたならクロスオリジンポリシーを気にしなくていいので xmlhttpRequest で blob 取得可能。
  • message event でファイル名を渡してダウンロードさせる。

画面遷移発生しました、今までのように使うことができない。

日本語が下手でごめん、英語を使えます。
Now when clicking the image it goes to the detail page instead of staying in the original page, the popup window still works just not able to view all the images in order like before.
I have been using the script for quite some time and very much appreciate your work, thank you.
ありがとうございます。

Improve error handling

異常系を見直したい。

DOMException コンソールになんの情報も残さない問題:
class AbortError extends Error{}するくらいしかない。Link

Uncaught 問題:
Hook 内部で処理するより fetcher 側でキャッチしてconsole.errorで出力、nullを返して終わる形?

related: #41

@grant none で動かすのをやめる

非公式 API を叩くためにクロスオリジン通信したい。
そのためには @grant none を辞める必要がある。

window.pixiv オブジェクト依存の部分を unsafeWindow.pixiv に置き換えるだけでなんとかなるか試す必要がありそう。

大きめの見直しを図らなければならない場合は最初から作りなおしも検討したい。
vue.js の 0.11 リリースのタイミングも見つつ考慮したい。

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.