Skip to content

Conversation

@HashidaTKS
Copy link
Contributor

@HashidaTKS HashidaTKS commented Aug 7, 2025

  • Fix comment

  • Improve wildcmp

  • Improve to check only the edge section

  • Remove a unused function

  • Support only Excludes and Patterns

  • Remove unused settings

  • Drop edge section

  • Add targets section to specify urls

  • Move WARNING_WHEN_CLOSE_DIALOG to GLOBAL section

return regex.test(string);
};

function wildcardToRegexp(source) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlexConfirmMailの https://github.com/FlexConfirmMail/Outlook-Office-Addin/blob/main/src/web/wildcard-to-regexp.mjs から移植。このファイルはMPL 2.0で、本リポジトリのファイルもMPL2.0で公開予定なので問題ないはず。

return false;
},

getBrowserName(section) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使っていなかったので削除した。


console.log(`* Lookup sections for ${urlToMatch}`);
for (const section of config.Sections) {
if (section.Name.toLowerCase() !== "edge")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

設定ファイル(のパーサー)は基本的にThinBridgeのものを流用しており、設定ファイルには複数のセクションを想定している。また、将来的にChromeなどでも同様の処理が必要になった場合に、複数セクションが定義できた方が良い。そのため、セクションを一つにするのではなくて、複数のセクションの中のedgeセクションのみを参照するように変更。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BROWSER定数があるので、それと比較する方がよいように思います。

Copy link
Member

@piroor piroor Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

それはそうと、「POSTの再送信を禁止するWebページのURLパターンのリスト」をブラウザーごとに持つ必要性ってあるのでしょうか……?
ニーズ的にはむしろ「どのブラウザーを使っているときでも、列挙したパターンに該当するページはPOSTの再送信を禁止する」という振る舞いになってくれた方が嬉しいように思いますが、どうでしょう。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BROWSER定数があるので、それと比較する方がよいように思います。

ThinBridgeにあったBROWSER_PATHのことで認識正しいでしょうか?
この設定値はRepostConfirmationCancelerでは消したので(ブラウザを起動することがないため)、存在しなくなっています。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

それはそうと、「POSTの再送信を禁止するWebページのURLパターンのリスト」をブラウザーごとに持つ必要性ってあるのでしょうか……? ニーズ的にはむしろ「どのブラウザーを使っているときでも、列挙したパターンに該当するページはPOSTの再送信を禁止する」という振る舞いになってくれた方が嬉しいように思いますが、どうでしょう。

確かに、URLパターンのリストはグローバルな設定の方が嬉しそうな気がしますね。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

内部的には複数セクションを持てるようになっていて、ただし今バージョンではTARGETSという名前のセクションだけを使う、ということだと理解しました。

他にセクションを持つとしたら、ブラウザーごとに何か対応していくというよりも、「POSTの再送信を自動キャンセル」以外に「このダイアログも自動キャンセルしたい」みたいな要望に応えていく場合の方がありえそうかなと思いました。
この方向性で機能を増やしていくとしたら、今回の名前付けも、[TARGETS]ではなく、[NO_REPOST_TARGETS]のようにした方がよいかもですね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BROWSER定数があるので、それと比較する方がよいように思います。

ThinBridgeにあったBROWSER_PATHのことで認識正しいでしょうか? この設定値はRepostConfirmationCancelerでは消したので(ブラウザを起動することがないため)、存在しなくなっています。


これのことを指しておりました。

なるほど。理解しました。

(今回BROWSER変数ではないセクションにすることになったので、使わなくなりました。)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

内部的には複数セクションを持てるようになっていて、ただし今バージョンではTARGETSという名前のセクションだけを使う、ということだと理解しました。

はい、最終的にそのようにしました。

他にセクションを持つとしたら、ブラウザーごとに何か対応していくというよりも、「POSTの再送信を自動キャンセル」以外に「このダイアログも自動キャンセルしたい」みたいな要望に応えていく場合の方がありえそうかなと思いました。 この方向性で機能を増やしていくとしたら、今回の名前付けも、[TARGETS]ではなく、[NO_REPOST_TARGETS]のようにした方がよいかもですね。

うーん、どうなんでしょう。
その方向性を想定する場合、拡張機能の名前自体がRepostConfirmationCancelerとなっているので、拡張機能の名前自体を変えた方が良い気も。。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

アイコンなどもリロード抑止のようなアイコンになっているので、一旦「別のダイアログをキャンセルしたい」という方向性は想定せずに、[TARGETS]のままでどうでしょうか?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

はい、同意です。
仮に将来適切な名前に変えるとしても、後方互換性のためのエイリアスとして対応することは容易ですし。

その方向性を想定する場合、拡張機能の名前自体がRepostConfirmationCancelerとなっているので、拡張機能の名前自体を変えた方が良い気も。。。

昔、FirefoでXULアドオン時代に「任意のダイアログの任意のボタンを自動で押すアドオン」というものを法人向けに提供していたことがあったのですが、WebExtenions化で使用できなくなってそのままとなっています。その代替あるいは後継として使えそう、という思いがあって先の発言につながっていました。
とはいえ、今の段階で備える必要性はそこまで高くはなく、このソフトウェアを一般向けにリリースした後でそういう相談が寄せられるようになったら、その時改めて考えればいいだろうと思っています。

@HashidaTKS HashidaTKS requested a review from piroor August 7, 2025 06:31
Copy link
Member

@piroor piroor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1点コメントした箇所以外はよいと思います!

* Remove unused settings
* Drop edge section
* Add targets section to specify urls
* Move WARNING_WHEN_CLOSE_DIALOG to GLOBAL section
@HashidaTKS HashidaTKS requested a review from piroor August 7, 2025 07:42
@HashidaTKS
Copy link
Contributor Author

HashidaTKS commented Aug 7, 2025

すみません、同じPRでNative messaging host向けの追加の指摘事項も対応してしまいました。

@HashidaTKS
Copy link
Contributor Author

すみません、正しく動いていないことが分かったので修正中です。

@HashidaTKS
Copy link
Contributor Author

修正済み。

Copy link
Member

@piroor piroor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@piroor piroor merged commit 3dd791d into main Aug 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants