Git Product home page Git Product logo

pttchrome's People

Contributors

classicdarkchocolate avatar darkland avatar iamchucky avatar iepiweidieng avatar kevinptt0323 avatar myjian avatar pc035860 avatar robertabcd avatar tomchentw avatar tsaiid 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  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  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  avatar  avatar  avatar  avatar

Watchers

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

pttchrome's Issues

和瀏覽器的密碼管理員整合

實作會有點複雜,要在 PTT 出現「輸入密碼」的文字的時候貼一個 <input type="password"> 在游標的位置,且把 focus 從隱形的 <input> 移過去。總之先開 issue 建議一下,感謝。

與Windows 11工作列衝突

瀏覽器: Chrome, Edge
OS: Windows 11 23H2

PttChromec的最下面一行,約一半被工作列擋住
需重新啟動Chrome才能解決

圖片預覽位置亂跳

如圖所示,正確的顯示方式(PttChrome):

https://imgur.com/4Glkgkp

異常(term.ptt.cc):

https://imgur.com/zDhx9wI

可看到最下面那張圖片的預覽窗格跳到上方的邊界之外了

(範例來源: #1ZK1c_RV (MobileComm) [ptt.cc] [討論] 安卓手機APP各種BUG)

經測試,只在按下F11的全螢幕模式下才會有此bug,一般模式則似乎正常

--
10/23補充:經再次確認,一般模式位置亦會亂跳,不限全螢幕模式

熱訊(水球)的偵測有時會失敗

問題描述

有時使用者送來熱訊時,並不會被正確偵測爲熱訊訊息,造成 PttChrome 不送出通知。

相關 issues:#77 & #78

細節描述

parseWaterball() 的正規表示式:

export function parseWaterball(str) {
var regex = new RegExp(/\x1b\[1;33;46m\u2605(\w+)\x1b\[0;1;37;45m (.+) \x1b\[m\x1b\[K/g);
var result = regex.exec(str);
if (result && result.length == 3) {
return { userId: result[1], message: result[2] };
} else {
regex = new RegExp(/\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m/g);

/\x1b\[1;33;46m\u2605(\w+)\x1b\[0;1;37;45m (.+) \x1b\[m\x1b\[K/g

這是在清除畫面底部後,某個使用者第一次送過來的熱訊的正規表示式。

/\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m/g

這是未清除畫面底部時,同一個使用者連續送過來的熱訊的正規表示式。

注意使用者代號被跳過。這是由於 pfterm 對輸出畫面資料的最佳化。

其中 \x1b\[24;\d{2}H 所匹配的,是設定游標位置的控制碼(屬於「移位碼」):

  • 24 是畫面底部的橫行的編號 (最上方的橫行的編號是 1)。
    • 但畫面高度可能超過 24 個橫行,造成匹配失敗。
  • \d{2} 是跳過了使用者代號後,熱訊內文的開頭所在的縱列的編號 (最左方的縱列的編號是 1)。
    • 但使用者代號可能很短,使熱訊內文開頭處所在的縱列編號 < 10,造成匹配失敗。

然而,由於 pfterm 的輸出最佳化,使用者端所接收到的熱訊訊息的格式,實際上不一定會符合以上任一狀況。
比如:如果有兩個代號前幾字相同的使用者送來熱訊,那麼輸出時就會從使用者代號不相同的部分開始輸出,這時就不會被以上兩個正規表示式匹配。

可能解法

App.prototype.onData() 內的判斷邏輯,改爲偵測可能是熱訊的資料。
而當偵測到有熱訊送來,則從畫面擷取眞正的熱訊訊息。

Live文小幫手失效

轉自: #1XThzXVK (PttBug) [ptt.cc]

回報內容:

如題,term.ptt.cc(以下簡稱term)是基於PttChrome製作而成的支援wss版本
而PttChrome內有一個「Live文小幫手」也被繼承過來
簡單來說它是一個可以在Live文中自動更新推文的小功能(最短可到1秒/次)
在收看特定直播(例如每日疫情記者會、電競比賽、三金頒獎)等狀況下很好用

但是,在term這邊的這個功能雖然有在右鍵功能表以及設定中顯示出來
實際上卻是無法使用,點選後毫無反應,一樣不會自動更新推文
而PTT網頁版雖然有自動更新推文並捲動的功能,但也早就故障許久未修
前往term的GitHub也可以發現最後一次commit已是去年4月
所以想在此同時請教:這個軟體及站點是否已經處於abandoned狀態...?

以上bug回報,問題的部分也同時希望有人可解答!

Basic support for iOS + external keyboard

Arrow keys are crucial in PTT experience. Currently it's not possible to use arrow keys on iOS, even with external keyboard. A possible simple fix for external keyboard is described below:

Here's a table of crucial keys for PTT, properties of KeyboardEvent, verified on iOS 11.2.5 Safari:

key keyCode
UIKeyInputTopArrow 0
UIKeyInputBottomArrow 0
UIKeyInputLeftArrow 0
UIKeyInputRightArrow 0
control Dead 0

Currently it looks impossible to identify "control" and combination keys. We'll focus on arrow keys below.

Issue 1: keyCode
This line of code filtered out all of those keys. Since keyCode is deprecated, key should be preferred (ref: KeyboardEvent, Example code).

Issue 2: key value
Sadly, iOS does not return standard key value (but macOS does). However, it's still possible to simply add those key values listed above to corresponding standard values, ex. case 'ArrowLeft' along with case 'UIKeyInputLeftArrow'.

右鍵貼上造成網頁卡死

狀況雷同前一位s101198
我不論是不是輸入區,只要按到右鍵貼上就會卡死
鍵盤輸入完全失效,按右鍵變回一般Firefox右鍵選單
可以直接F5重置回登入畫面

Shift+Insert貼上則不會有問題

使用Firefox官方版62.0.2 64bit
嘗試套件全關依然有問題
用Cent Browser登入右鍵貼上沒有問題
附上term設定供參考
term ptt

進行水球通知時檢查權限並且要求權限

使用環境:
作業系統: OSX
瀏覽器: Chrome

目前水球來的時候不會跳通知,沒有 notification 應該是被瀏覽器擋下來了
建議在 term_view.js 的 showWaterballNotification 新增

    if (Notification.permission != 'granted') {
      Notification.requestPermission()
    }

來解決這個問題。
原先的程式碼是這樣:

 showWaterballNotification: function() {
    if (!this.enableNotifications) {
      return;
    }
    var app = this.bbscore;

修改成:

 showWaterballNotification: function() {
    if (!this.enableNotifications) {
      return;
    }
    if (Notification.permission != 'granted') {
      Notification.requestPermission()
    }
    var app = this.bbscore;

Microsoft Edge下End無作用

在Microsoft Edge下,Home,Page up,Page down都正常,唯讀End不起作用
試了Firefox和Chrome,都沒有這項問題

這是Edge本身的限制嗎,或者有辦法透過修正解決?

Incorrect urls in css

Fonts and other images in compiled css look like:

@font-face {
  font-family: SymMingLiu;
  src: url(assets/symmingliu.aaa394dd81dbe129da06687a75bfe002.woff)
}

The url should be relative to the css file, so it shouldn't have assets/ prefix.

resolve-url-loader seems to be advertising to do the trick but I can't make it to work.

A quick workaround on the server side can be implemented fairly easily.

macOS 倉頡輸入法輸入「:」會進到說明頁

原本以為不同輸入法都會遇到一樣的問題,
結果發現注音輸入法好像無法重現(?)

問題:
在 macOS 編輯/發表文章時,
使用內建倉頡輸入法打全形冒號「:」會跳到說明的頁面,
就是按 Ctrl+Z 進到的頁面
注意輸入法因為不會直接輸入
所以不會有這個問題
倉頡輸入法會直接輸入「:」
但不知道被解讀成什麼了所以會跳到說明頁面

若干bug/限制希望能修復

1. 開啟滑鼠瀏覽下左鍵點擊連結沒有效果(已解決)
2. 貼上操作開放使用滑鼠執行
3. 滑鼠瀏覽底色設定問題
4. 內建自動登入功能(如果做得到的話)

Mac 鍵盤使用 Safari 13.0.3 (macOS 10.14.6) 無法貼上

鍵盤上沒有 Insert 鍵 😭

普通 Mac 上使用的 Cmd + V 沒有作用(應該可以聽 paste event 取得貼上的字串),但要測試才知道會不會在 PC 上和 Ctrl + V 衝突(要輸入 Ctrl + V 變成貼上字串 ...)

linux下輸入法會抓不到游標位置

用中文輸入法 不管是 fctix ibus hime 游標都不會跟隨輸入位置 而是停在螢幕最左邊
不管是chrome firefox 都一樣
應該可以確定是這裡的issue
之前有莫名其妙恢復正常過 但現在又是老樣子

閒置斷線

嗨請問一下,最近會一直遇到只要閒置五分鐘 就會斷線還要重新連線才可以回來的問題?
請問這問題會是哪邊的問題呢?

解析水球的正則表示式的呈現方式問題

遇到的問題: 純粹程式碼寫法問題

parseWaterball (string_utils.js:L155)[https://github.com/robertabcd/PttChrome/blob/88e3562e6536cc0a91dbbb9f65e59036e4b73b79/src/js/string_util.js#L155]

當中的正則表示式

export function parseWaterball(str) {
  var regex = new RegExp(/\x1b\[1;33;46m\u2605(\w+)\x1b\[0;1;37;45m (.+) \x1b\[m\x1b\[K/g);
  var result = regex.exec(str);
  if (result && result.length == 3) {
    return { userId: result[1], message: result[2] };
  } else {
    regex = new RegExp(/\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m/g);
    result = regex.exec(str);
    if (result && result.length == 2) {
      return { message: result[1] };
    }
  }
  return null;
};

其中如果使用了 new RegExp 的話,那應該就不需要外面以 / 包圍了吧?
也就是應該改成

var regex = /\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m/g;

或是

var regex = new RegExp("\x1b\[24;\d{2}H\x1b\[1;37;45m([^\x1b]+)(?:\x1b\[24;18H)?\x1b\[m", "g");

這樣?

Restore image preview for URL with certain extensions

type=? on the anchor tag

s0 += '<a scol="'+col+'" class="y q'+this.deffg+' b'+this.defbg+'" href="' +ch.getFullURL() + '"' + this.prePicRel( ch.getFullURL()) + ' rel="noreferrer" target="_blank" srow="'+row+'">';

it's used to annotate that the link is an image. Later, the it uses css selector to find all the images and does further processing:

".main a[type='p']",

From:
#21 (comment)

Ubuntu 18.04/Linux MINT 19 + Chrome + fcitx 無法正常中文輸入

在Ubuntu 18.04/Linux MINT 19,使用fcitx輸入法框架,目前無法正常在Chrome/Opera等Chromium base的瀏覽器正常中文輸入,但在FireFox是沒問題的,以前是能正常輸入的,不確定是不是Chrome更新後產生的問題…
PS: PttChrome沒問題,是term.ptt.cc有問題....是不是應該改向ptt站方反應,不好意思 XD

驗證碼頁面的右鍵貼上選項失效 (Firefox 62.0)

PTT最近投票需要取得驗證碼
但是當使用右鍵選單貼上的時候
驗證碼無法貼上 且會造成畫面直接卡死在驗證畫面 只能重新整理

而使用快捷鍵、Chrome沒有這些問題
我想這應該是個bug 就麻煩大大修復一下惹@@

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.