artDialog icon indicating copy to clipboard operation
artDialog copied to clipboard

在6.0.4版本中自动生成的iframe没有被销毁

Open benleilei opened this issue 10 years ago • 2 comments

在 6.0.4 版中修正 #126 问题时,自动生成的 iframe 没有被销毁,这样会引发内存泄漏吧

benleilei avatar Apr 16 '15 06:04 benleilei

建议修改方法: 在 dialog-plus.js 中

  1. 移动 77 行代码 api.content($iframe[0]) 到 68 行前
  2. 修正移除 iframe 的事件:改 beforeremove 事件为 remove 事件。

benleilei avatar Jul 20 '15 01:07 benleilei

我发现IE11似乎不存在这个问题,但是用Chorme 89、Edge 85,会出现这个bug (应该是最前几个版本也存在)。我是这样尝试解决这个问题的: 将 dialog-plus.js 的 1563行开始这行代码

api.addEventListener('beforeremove', function () {

改为

api.addEventListener('remove', function () {

修改后,清理浏览器缓存,测试正常(再也不会看到重复的本该销毁的iframe。还没有充分测试,不知道有没有其他副作用。

nhafeng avatar Apr 05 '21 02:04 nhafeng