想要替换外部脚本HTTP请求(WordPress网站,不能使用插件)
我有一个客户要求我解决他的问题。他会因其广告障碍物所阻挡外部JS脚本而遇到错误。主要是CDN站点。他不会让我们安装插件。
我开始考虑一个创意的解决方案,并编码了一些东西以在本地存储外部文件。(这是这样做的,不是询问存储文件)
我试图使用ob_start()替换Head Tag中的脚本链接,但它们似乎似乎以后加载,可能是插件的Ajax。我不知道。
另一个问题是,有些没有内联加载。 外部JavaScript文件正在其他地方加载。
有人知道我如何为客户解决这个问题吗? .htaccess是否会重定向将HTTP请求重定向到所有活动中并解决此问题?
I have a client who is asking for me to solve his issue. He gets errors for external js scripts getting blocked by his ad blocker. Mainly CDN sites. He wont let us install plugins.
I began to think of a creative solution, and coded up something to store external files locally.(This is done, not asking about storing files)
I was trying to use ob_start() to replace script links in the head tag, but they seem to be loading later, probably aJax, from plugins. I don't know.
Another issue is that some aren't getting loaded inline.
The external javascript files are getting loaded somewhere else.
Does anyone have any idea how I can solve this for my client?
would .htaccess redirects redirect the http requests across all activity and solve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论