Commit 6663825
committed
behaviors: allow extracting outlinks
Currently, our JavaScript outlink extraction happens purely via our
non-configurable extract-outlinks.js script. However, given that
many sites can have unpredictable behaviour we may want special
handling for, it would be great to let us configure this on a per-
site basis. We already have a system for this for interacting with
sites using our behaviour system; if we expand this to also provide
outlinks, we can give ourselves a much more flexible system to
handle complex or special-case websites.
This extends the behaviour system so that we can now return a
JavaScript object with information about the site. That object
should contain at least the "finished" key, which is a boolean that
works like the simple boolean returned by older versions. The
object can additionally contain an "outlinks" key which, if present,
should be an array of links for brozzler to handle as outlinks.
I've retained backwards compatibility by checking to see if the
returned object is a boolean and handling it like we did previously.1 parent 47f5c06 commit 6663825
1 file changed
+22
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
638 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
639 | 642 | | |
640 | 643 | | |
641 | 644 | | |
| |||
653 | 656 | | |
654 | 657 | | |
655 | 658 | | |
656 | | - | |
| 659 | + | |
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
| |||
766 | 769 | | |
767 | 770 | | |
768 | 771 | | |
769 | | - | |
| 772 | + | |
770 | 773 | | |
771 | 774 | | |
772 | 775 | | |
| |||
857 | 860 | | |
858 | 861 | | |
859 | 862 | | |
860 | | - | |
| 863 | + | |
861 | 864 | | |
862 | 865 | | |
863 | 866 | | |
| |||
870 | 873 | | |
871 | 874 | | |
872 | 875 | | |
873 | | - | |
| 876 | + | |
874 | 877 | | |
875 | 878 | | |
876 | 879 | | |
| |||
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
896 | | - | |
897 | | - | |
898 | 899 | | |
899 | | - | |
900 | | - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
901 | 914 | | |
902 | 915 | | |
903 | 916 | | |
| |||
0 commit comments