Difference between revisions of "Template:NoReferer/doc"
(Created page with "This template is used to specify the <code>Referrer-Policy</code> of the page as <code>no-referrer</code>, so as to avoid websites such as B station that request the Referer b...") |
|||
Line 1: | Line 1: | ||
− | This template is used to specify the <code>Referrer-Policy</code> of the page as <code>no-referrer</code>, so as to avoid websites such as | + | This template is used to specify the <code>Referrer-Policy</code> of the page as <code>no-referrer</code>, so as to avoid websites such as Bilibili that request the Referer by checking the picture to realize the anti-leech mechanism. Index images, and upgrade images whose domain name is the http address of the specified website to an https address. |
'''If the target website forbids the empty Referer to obtain pictures, nothing can be done. ''' | '''If the target website forbids the empty Referer to obtain pictures, nothing can be done. ''' |
Latest revision as of 15:21, 11 April 2022
This template is used to specify the Referrer-Policy
of the page as no-referrer
, so as to avoid websites such as Bilibili that request the Referer by checking the picture to realize the anti-leech mechanism. Index images, and upgrade images whose domain name is the http address of the specified website to an https address.
If the target website forbids the empty Referer to obtain pictures, nothing can be done.
Cold knowledge: When the standard writers made a typo when writing referrer-related standards, they marked referrer as referer (less r), and later reserved this typo in the HTTP header for compatibility (but referrer is used in other standards such as DOM) ).
Parameters
This template has an optional parameter domain
, you can enter the domain name of the website that needs to be upgraded to https address (to save the effort of replacing the picture address of the website, especially put it in other templates - such as VC page templates ——It can save the operation of batch editing a large number of pages). You can fill in only a part of the domain name (but do not provide wildcards, etc.), you can use |
({{!}}
) segmentation.
This template adds hdslb.com
to the list of domain names to be upgraded by default.
Effect
- Source code
{{NoReferer}}<img src="http://i0.hdslb.com/bfs/archive/a0bd7e1f3621502d4bd8a7fd7ca6a9c34008e689.jpg" style=" width:400px;max-width:100%;"/>
- Result (you can right-click the image to check the element to see if the image address protocol is https)