FWIW, I think this is the right approach - make sure the page provides LibreJS with the information and make sure LibreJS provides the user with the information. Making sure the page legitimately provides the user the information is going to be messy, and if it's provided by LibreJS it will always be in the same place whatever the site design.
On Sat, Feb 22, 2014 at 8:39 AM, Sebastian Noack <[email protected]>wrote: > Hi Loic, > > you might be able to override a "display: none;" style, but then websites > that want to hide the link, can still just position it out of the visible > area, remove it with javascript after the site was loaded, or use the > Shadow DOM to hide it. So if somebody wants to hide the web labels link, he > can do it without that LibreJS will be able to know that it is hidden. > > Beside the technical difficulties to prevent hiding the web labels link, I > think there are legit cases, where we should allow websites to hide that > link. For example on pages that doesn't contain any other navigation > elements, like pages that show media in full screen. > > So wouldn't it be better to allow websites to hide the link without any > hacks, with a <link> tag in the header. And show the link, doesn't matter > whether it is visible on the the web page, additionally in the LibreJS > overlay? > > Cheers > Sebastian > > > On Sat, Feb 22, 2014 at 5:08 PM, Loic J. Duros <[email protected]> wrote: > >> >> Actually, I'm going to run this by the boss, since I'm not sure we want >> to encourage web developers to hide the link. One thing LibreJS could do >> is force the link to be displayed. This way anyone with LibreJS would >> actually see the link, even if the CSS on the page attempts to hide it. >> >> Sebastian Noack <[email protected]> writes: >> >> > Hi, >> > >> > a lot of websites (including https://www.eff.org/) hide the web labels >> link >> > anyway with CSS. So why don't let people use a link-tag as an >> alternative to >> > an a-tag to specify their web labels page, in case they don't want have >> a >> > visible link? We can't force them to show the link anyway, but hiding >> it with >> > CSS looks like a hack, since that is what the link-tag is for. You find >> the >> > patch in the attachment. >> > >> > Cheers >> > Sebastian >> > >> > >> > diff -Naur >> /tmp/librejs-5.4.1.old/lib/html_script_finder/web_labels/js_web_labels.js >> /tmp/librejs-5.4.1.new/lib/html_script_finder/web_labels/js_web_labels.js >> > --- >> /tmp/librejs-5.4.1.old/lib/html_script_finder/web_labels/js_web_labels.js >> 2013-10-26 00:35:13.000000000 +0200 >> > +++ >> /tmp/librejs-5.4.1.new/lib/html_script_finder/web_labels/js_web_labels.js >> 2014-02-04 22:43:58.723030048 +0100 >> > @@ -86,7 +86,7 @@ >> > >> > searchForJsLink: function () { >> > //console.log('triggered searchForJsLink'); >> > - var linkTags = this.dom.getElementsByTagName('a'), >> > + var linkTags = this.dom.querySelectorAll('a,link'), >> > i = 0, >> > len = linkTags.length, >> > path; >> > >
