Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anti-theft chain image save failure #1563

Open
wjsw1781 opened this issue Sep 11, 2024 · 5 comments
Open

Anti-theft chain image save failure #1563

wjsw1781 opened this issue Sep 11, 2024 · 5 comments

Comments

@wjsw1781
Copy link

Describe the bug

i find the website save is ok ,but the img can not save,because the web open the Anti-theft rule, i know you get the img binary in background.js ,it will be error, could you use fetch in contentjs ? it will work!
the url is
https://weibo.com/1699432410/OwmaceM4N
image
image
image

you see,it is 403! but if you run fetch() in contentjs context,it will be fine!
image

the reason is reffer can not be set in popup,backgroud, slider,or other context, but contentjs can auto use the reffer in header,then bypass the rule!

@wjsw1781
Copy link
Author

you can mv the img2base64 from backgroud to contentjs or mv as much logic as possible from backgroud to contentjs!
it is big job, so the dicision is on you! i want to say 存储一个页面资源的过程html css font img,直觉上就应该在contenjs,而不是在backgroundjs中! 遍历dom, hook iframe ,download img ,都应当放在contentjs中运行 background只关注事件!

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Sep 17, 2024

I cannot reproduce a successful fetch of the resource you mentioned in Chrome with the Dev Tools. See below. Note however that what you described is already implemented in SingleFile and works fine in Firefox.

image

@wjsw1781
Copy link
Author

Do you mean the firefox version of SingleFile? Can you give me an address?

@wjsw1781
Copy link
Author

i find it is ok in firefox! why? if it in edge or chrome ,it could not save the anti-img! could you give me a issue about it ? i want to study it ,thank you !!!!

企业微信截图_17266464933592 企业微信截图_17266465114547

@wjsw1781
Copy link
Author

wjsw1781 commented Sep 18, 2024

i guess someone have talked about it , but i can not find those talkings, i am chinese , i could not search it good enough.
and i really want to know how firefox can bypass the rule of anti-img! does it use fetch in context of contentjs? or use other way? i really want to know !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants