Giter VIP home page Giter VIP logo

autopatchwork's Issues

2ページ目を継ぎ足した時点でページ全体の高さが変わらないとAutoPatchWorkが(正常に)強制終了する

https://github.com/os0x/AutoPatchWork/blob/master/AutoPatchWork.safariextension/includes/AutoPatchWork.js#L702
全体の高さが変わらないとき、ここ、702行目の判定が真になって、3ページ目以降が存在しても正常終了します。
サイトバーがpageElementより倍以上の高さがあるようなページで発生します。

Amazon.co.jpの検索結果の最初のページが2回表示される

こんにちは。
サイト固有かつFirefox+AutoPagerizeなどでも再現する問題なので、AutoPatchWorkのIssueとするのが適切かどうかわかりませんが、SITEINFOの修正だけでは解決できそうにない問題のような気がしたのでここに書き込ませていただきました。
もしSITEINFOの修正だけで済む問題だったらすみません。

Amazon.co.jpではある条件下 (詳細は不明ですが、手元ではAmazonにログインすると再現しました) でページャが新しいタイプのものに置き換えられるらしく、今回の問題はこの新しいページャで起きる問題です。
新しいページャでは、hash fragmentを利用して動的にページ切り替えを行うようになっており、それに伴ってnextLinkで指定されているpagnNextLinkのhrefが#から始まるものに変更されています。そのため、AutoPatchWorkが動作するとそのとき開いていたURLの内容がそのまま継ぎ足されてしまいます。SITEINFOを修正できないかと思ったのですが、DOMツリー上にnextLinkとして使えるような代わりの要素が見当たらなかったので、対処方法がわかりませんでした。
なお、問題が起きるのは最初の1回だけで、2回目以降は正しいページが継ぎ足されます。これは、pagnNextLinkのhrefはHTMLの時点では#から始まるものにはなっておらず、JavaScriptで動的に変更しているためだと思われます。

よろしくお願いします。

AutoPatchWork forgets settings

On Safari (7.0.1 currently) AutoPatchWork seems to have problems respecting the settings from time to time. I mean the checkboxes and radios remain checked/unchecked correctly, but AutoPatchWork often ignores them, causing unwanted behaviors, and requires user to manually toggle them again just to make it work.

Any ideas?

calc_remain_height function accepts off-display nodes

The calc_remain_height shouldn't accept nodes that don't have visual representation, like script or style, but it does and it breaks extension on some pages. Here is the corrected version:

        function calc_remain_height() {
            var rect = null, bottom = null, _point = insert_point;
            while (_point) {
                if (typeof _point.getBoundingClientRect === 'function') {
                    rect = _point.getBoundingClientRect();
                    if (rect && !(rect.top === 0 && rect.right === 0 && rect.bottom === 0 && rect.left === 0)) break;
                    else rect = null;
                }
                if (_point.nextSibling) _point = _point.nextSibling;
                else break; 
            }
            if (rect) {
                bottom = rect.top + window.pageYOffset;
            } else if (append_point && typeof append_point.getBoundingClientRect === 'function') {
                rect = append_point.getBoundingClientRect();
                bottom = rect.top + rect.height + window.pageYOffset;
            }
            if (!bottom) bottom = Math.round(rootNode.scrollHeight * 0.8);
            return rootNode.scrollHeight - bottom + options.BASE_REMAIN_HEIGHT;
        }

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.