Comments (3)
应该是因为
// delay to reduce the image element in big image frame;
this.debouncer.addEvent("REDUCE", () => {
const distance = this.getRealOffsetTop(this.elements.curr[0]!) - this.frame.scrollTop;
if (this.tryReduce()) {
this.restoreScrollTop(this.elements.curr[0]!, distance);
}
}, 500);
这里有个500毫秒后,移除视图外的大图
的功能。
如果在500毫秒内退出了大图阅读模式,由于所有的大图都已经被删除了(this.hidden > this.resetElements)。
所以最后在这个功能被延迟执行的时候,this.elements.curr[0]!
是undefind的,就报错了。(this.elements.curr[0]
就是大图视图中最中心的图片)
这个移除视图外大图
的功能,是为了防止太多的大图留在页面,增加渲染压力。(我猜的)
from eh-view-enhance.
我再想想有什么更好的方式来提升性能,现在图片多了后会增加数倍的内存占用。
from eh-view-enhance.
from eh-view-enhance.
Related Issues (20)
- Middle mouse to load tabs in background (rather than focus) HOT 2
- 键盘操作没反应? HOT 4
- [enhancement]: onion website support HOT 2
- Unable to function properly on MacOS and Safari browser. HOT 3
- Multiple page Hitomi.la closes viewer HOT 1
- [Feature Request] option to choose/download between native image format (webp, avif, jxl...etc) HOT 2
- Allow reconfigure of auto page turn keybind HOT 1
- Add auto-open eh-view-enhance on gallery open option HOT 3
- Viewer Shows a Grey Outline HOT 2
- 脚本的图标未显示 HOT 5
- 脚本更新后无法使用 HOT 2
- Big Mode HOT 6
- Pixiv Gifs
- 在chrome下无法在阅读模式加载图片 | Failed to load images via read mode on Chrome HOT 4
- twitter reverse order for post with multiple images attatched for user media page viewing HOT 2
- Question: about download option HOT 2
- Add support for HentaiNexus HOT 1
- 建议:增加“帮助”按钮的辨识度 HOT 1
- Hentai Nexus Image Bug HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eh-view-enhance.