Skip to content

Commit

Permalink
fix(chromium): disable lazy loading iframes (#3535)
Browse files Browse the repository at this point in the history
These do not play nicely with our "page is loaded when all frames
are loaded" logic.
  • Loading branch information
dgozman authored Aug 19, 2020
1 parent f13cebc commit 0a22e27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/chromium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const DEFAULT_ARGS = [
'--disable-dev-shm-usage',
'--disable-extensions',
// BlinkGenPropertyTrees disabled due to crbug.com/937609
'--disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies',
'--disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
'--disable-popup-blocking',
Expand Down
6 changes: 6 additions & 0 deletions test/assets/frames/lazy-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div style="height: 1000px; width: 1000px; background: red">One</div>
<div style="height: 1000px; width: 1000px; background: blue">Two</div>
<div style="height: 1000px; width: 1000px; background: red">Three</div>
<div style="height: 1000px; width: 1000px; background: blue">Four</div>
<div style="height: 1000px; width: 1000px; background: red">Five</div>
<iframe loading="lazy" src='./frame.html'></iframe>
5 changes: 5 additions & 0 deletions test/page-goto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,8 @@ it.skip(true)('extraHttpHeaders should be pushed to provisional page', async({pa
expect(htmlReq.headers['foo']).toBe(undefined);
expect(cssReq.headers['foo']).toBe('bar');
});

it('should work with lazy loading iframes', async({page, server}) => {
await page.goto(server.PREFIX + '/frames/lazy-frame.html');
expect(page.frames().length).toBe(2);
});

0 comments on commit 0a22e27

Please sign in to comment.