Alex4386 / turnoff-namuwiki

조별과제 때마다 "나무위키 꺼라."라고 말하시는게 피곤하신 여러분을 위해 만들어진 Browser Extension, 나무위키를 꺼 드립니다.
https://chrome.google.com/webstore/detail/dgdifdnmamleoebgfbfeckefhhhplmdn
MIT License
84 stars 5 forks source link

[Feature Request] Custom Redirecting Configuration (맞춤형 자동접속 설정) #92

Open NangmanGureum opened 5 months ago

NangmanGureum commented 5 months ago

ISSUE: Feature Request

추가를 원하는 기능이 무엇인가요? What kind of feature you are requesting?

어떤 기능을 추가했으면 좋을까요? (What feature you are requesting?)

정확하게 설명해 주세요 (Please explain it in detail)

As in a title, I wish to add to custom redirect configuration function. 제목처럼, 맞춤형 자동접속 설정 기능이 추가되었으면 좋겠습니다.

Example:

When you set like this:

Table 1 (Which registered special words) keyword category correspond_word
토키노 소라 hololive ときのそら
로보코 씨 hololive ロボ子さん
AZKi hololive AZKi
... ... ...
Table 2 (Which registered custom redirect site) category to_url encode_as
hololive https://seesaawiki.jp/hololivetv/d/{} EUC-JP
nijisanji https://wikiwiki.jp/nijisanji/{} UTF-8
774inc https://wikiwiki.jp/774inc/{} UTF-8
... ... ...

So, what happen:

  1. Enter "https://namu.wiki/w/%EC%8B%9C%EB%9D%BC%EC%B9%B4%EB%AF%B8%20%ED%9B%84%EB%B6%80%ED%82%A4"
  2. Recognize entering "namu.wiki"
  3. Extract a keyword with decoding URL (In this case, which is "시라카미 후부키", Shirakami Fubuki in Hangul.)
  4. Search the keyword at Table 1 (In this case, this category section will be "hololive" and the correspond_word part is "白上フブキ")
  5. Search the category of keyword at Table 2
  6. Encode correspond_word with specified encode format. (e. g. UTF-8, EUC-KR, Shift_JIS, etc.) (In this case, the specified format is EUC-JP. so, it will got %C7%F2%BE%E5%A5%D5%A5%D6%A5%AD)
  7. Make a URL which combined with the to_url and the encoded keyword. (In this case, to_url is https://seesaawiki.jp/hololivetv/d/{}, and {} is where the encoded keyword goes. So it goes "https://seesaawiki.jp/hololivetv/d/%C7%F2%BE%E5%A5%D5%A5%D6%A5%AD" )
  8. And redirect to the URL

참고자료 (Reference)

Alex4386 commented 5 months ago

인코딩 작업의 경우 조금 부하가 예상되므로, 추가 대응이 필요해 보임. 커스텀 redirectedSites.json 에 대한 대응은 추후 검토.