谷歌在请求外部文件的离线/本地主机应用程序中美化

Google prettify in an offline / localhost application requesting external files

本文关键字:主机 应用程序 请求 外部 文件 离线 谷歌      更新时间:2023-09-26

谷歌美化对我来说效果很好。我已经构建了一个带有Twitter引导前端和google美化语法突出显示的应用程序。但是该应用程序也用于离线工作,例如本地主机,所以我包括了美化.js和美化.css。

现在,当我离线并在应用程序中工作时,它将开始通过本地 prettify.js 版本查找在线代码:

  • https://google-code-prettify.googlecode.com/svn/loader/lang-"+encodeURIComponent(D[m])+".js

  • https://google-code-prettify.googlecode.com/svn/loader/skins/"+encodeURIComponent(N[m])+".css

  • https://google-code-prettify.googlecode.com/svn/loader/prettify.css

离线工作正常,但是为什么它请求外部js和css文件以及如何将其从缩小的美化中删除.js?我不需要它,它正在减慢应用程序的速度。

GettingStarted wiki 页面解释道:

提供自己的JS和CSS

您可以下载脚本和样式并自行提供。确保同时包含脚本和样式表:

<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>