thumbnail-zoom
thumbnail-zoom copied to clipboard
Allow users to define their own site rules
trafficstars
Allow users to write their own rules to support sites which TZP doesn't otherwise support. Ideally this should be do-able by non-programmers. Rules could be stored in preferences. It'd be useful for users to be able to send their users to the developer to be added in as official rules.
Sites like AutoPager have a web server which allows users to upload, share, and download rules, but that requires additional programming and creating and supporting the web service.
J.G. writes in email:
Maybe a text input form and a guide on how to make your own rules with the help of add-ons like Firebug etc. would be enough. What do you think? Is this possible? Very complicated? Or don't you like the idea? HTTPS Finder https://addons.mozilla.org/en-us/firefox/addon/https-finder/ (can create rules to be included in HTTPS Everywhere (https://www.eff.org/https-everywhere)) AutoPager https://addons.mozilla.org/en-us/firefox/addon/autopager/?src=search PopTip (Greasemonkey script. Lets you make your own thumbnail pop-ups rules) https://userscripts.org/scripts/show/32219
Implementation steps:
- Restructure site definitions to be more data-driven. EG instead of the rule directly calling string replace methods, have the definition merely define 'from' and 'to' patterns (and possibly an override function).
- Add a "Custom" page type, checkbox, and preference.
- Add a way for users to edit Custom rules. This might be a list editor to select a particular custom rule, and details editor to edit the selected rule. Details editor might have rule name, site domain name pattern, thumbnail 'from' pattern, thumbnail 'to' replacement, and image filename pattern. This would essentially add into the logic of the "Others" and "Thumbnails" rules. It'd work for many sites, but not for sites whose image filename is determined from a node other than the thumb's img or link's a node.
- Implement the "Custom" rule, applying the user's definitions.
- It'd be helpful to also implement Issue #40: Change Site 'Enable' GUI To Support More Sites
- Add an option to copy the select rule(s) to the clipboard or to email them to the developer.
See also file src/Similar_Addons.html in the TZP source tree.