feat: csm img add referrerpolicy="no-referrer" (#2564)

* enhance: csm img add referrerpolicy="no-referrer"

fix #2563

* close #2494

* Update csm.js
This commit is contained in:
Cloud
2019-07-07 20:39:30 +08:00
committed by DIYgod
parent 3dec771ede
commit ffcca63d36
2 changed files with 9 additions and 4 deletions

View File

@@ -19,8 +19,8 @@ RSSHub is a lightweight and extensible RSS feed aggregator, it's able to generat
### Sponsors
| [Eternal Proxy](https://proxy.eternalstudio.cn/?from=rsshub) | [Liuyang](https://github.com/lingllting) | [Sayori Studio](https://t.me/SayoriStudio) | 匿名 | [Sion Kazama](https://blog.sion.moe) |
| :----------------------------------------------------------: | :--------------------------------------: | :----------------------------------------: | :--: | :----------------------------------: |
| [Eternal Proxy](https://proxy.eternalstudio.cn/?from=rsshub) | [Liuyang](https://github.com/lingllting) | [Sayori Studio](https://t.me/SayoriStudio) | Anonymous | [Sion Kazama](https://blog.sion.moe) |
| :----------------------------------------------------------: | :--------------------------------------: | :----------------------------------------: | :-------: | :----------------------------------: |
[![](https://opencollective.com/static/images/become_sponsor.svg)](/support/)
@@ -55,7 +55,7 @@ Logo designed by [sheldonrrr](https://dribbble.com/sheldonrrr)
::: tip
Free feel to test the [demo instance](https://rsshub.app), the cache expiry time is set to 10 minutes.
Feel free to test the [demo instance](https://rsshub.app), the cache expiry time is set to 10 minutes.
:::

View File

@@ -33,7 +33,12 @@ module.exports = async (ctx) => {
const article = cheerio.load(response);
article('[style="display: none;"], [style=" display: none;"], [style="display: none"]').each((i, e) => {
$(e).remove();
article(e).remove();
});
article('#js_content img').each((index, elem) => {
const $elem = article(elem);
$elem.attr('referrerpolicy', 'no-referrer');
});
const single = {