Git Product home page Git Product logo

Comments (6)

machsix avatar machsix commented on May 20, 2024

不能,GM_xmlhttpRequest拿到的内容默认是utf8,要自己decode。fetch api之类的也一样。
1mb而已,其实还好。我留着也是因为GM_xmlhttpRequest的decode要自己设置

if (options.html && _.isString(options.encoding)) {
config.overrideMimeType = `text/html; charset=${options.encoding}`;
}

我想以后换成fetch API, 虽然也可以自己设置ContentType,但还是不太爽

from super-preloader.

heroboy avatar heroboy commented on May 20, 2024

我就是没有找到你任何decode的地方才问的。

from super-preloader.

machsix avatar machsix commented on May 20, 2024

看上面的。

from super-preloader.

heroboy avatar heroboy commented on May 20, 2024

而且现代浏览器都能用TextDecoder了,不用自己decode了。你已经用了Array.includes了,已经抛弃老的浏览器了吧。
@include http*的脚本,尽量优化一下吧。
#238 的问题估计就是因为iframe太多了,载入脚本太慢了。

from super-preloader.

heroboy avatar heroboy commented on May 20, 2024

我测试一下在firefox+tampermonkey,关闭所有规则。
打开example.com,如果开启这个脚本的话,大约需要额外多执行100ms的js时间。
所以,像mdn这种iframe很多的网站,卡死也是可能的。

from super-preloader.

heroboy avatar heroboy commented on May 20, 2024

继续测试了一下,chrome+tampermonkey + example.com+禁用所有规则
页面载入完成之后,所有脚本执行时间:

  • 不开启这个脚本:50ms
  • 开启:200ms
  • 开启了移除这个模块之后的版本(脚本大小变成一半):170ms

from super-preloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.