mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: ensure frame.url() includes the query string (#6398)
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
This commit is contained in:
parent
7b24e5435b
commit
b6bbfd0ede
@ -1231,7 +1231,7 @@ export class Frame {
|
|||||||
*/
|
*/
|
||||||
_navigated(framePayload: Protocol.Page.Frame): void {
|
_navigated(framePayload: Protocol.Page.Frame): void {
|
||||||
this._name = framePayload.name;
|
this._name = framePayload.name;
|
||||||
this._url = framePayload.url;
|
this._url = `${framePayload.url}${framePayload.urlFragment || ''}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
1
test/assets/frames/one-frame-url-fragment.html
Normal file
1
test/assets/frames/one-frame-url-fragment.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<iframe src='./frame.html&test=fragment'></iframe>
|
@ -256,5 +256,15 @@ describe('Frame specs', function () {
|
|||||||
expect(frame1).not.toBe(frame2);
|
expect(frame1).not.toBe(frame2);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
it('should support url fragment', async () => {
|
||||||
|
const { page, server } = getTestState();
|
||||||
|
|
||||||
|
await page.goto(server.PREFIX + '/frames/one-frame-url-fragment.html');
|
||||||
|
|
||||||
|
expect(page.frames().length).toBe(2);
|
||||||
|
expect(page.frames()[1].url()).toBe(
|
||||||
|
server.PREFIX + '/frames/frame.html&test=fragment'
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user