Code copied verbatim, but does not work.
I can see that $pdfs.attr('download', true); transfers the attribute of download and sets it to true in the elements of my console but the pdf file does not download. I have checked and double checked the syntax, root properties and everything else I could think of. Using chrome on a Ubuntu OS, could that have something to do with it? code as follows; const $odd = $('a:odd'); // $odd.hide(); const $secureLinks = $('a[href^="https://"]'); // $secureLinks.hide(); const $pdfs = $('a[href$=".pdf"]'); // $pdfs.hide();
// Open link in new tab $secureLinks.attr('target', '_blank'); // Download instead of opening in browser $pdfs.attr('download', true);
Elias GuderianFront End Web Development Techdegree Graduate 14,994 Points
Hallo there, I had the same problem and I changed the setting and it still works so Reinhard Liess you are incorrect. I don't know anything about same-origin links though but I followed the instruction and it worked although it was kinda difficult to find the option. I don't really like googles settings layout.