gecko-dev/browser/components/genai/LinkPreviewParent.sys.mjs
Tim Xia 28d611c59f Bug 1952011 - Implement fetch for Link Preview - r=Mardak,firefox-desktop-core-reviewers ,firefox-ai-ml-reviewers,mconley
- add fetch in child process
- DOM parsing only once
- check content-type to be text/html before fetching content
- add custom request header x-firefox-ai so publisher has option to allow/disallow the fetch request
- more fetch safeguards(max content-length) may come in the near future

Differential Revision: https://phabricator.services.mozilla.com/D240654
2025-03-11 05:15:02 +00:00

12 lines
454 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* JSWindowActor to pass data between LinkPreview singleton and content pages.
*/
export class LinkPreviewParent extends JSWindowActorParent {
async fetchPageData(url) {
return this.sendQuery("LinkPreview:FetchPageData", { url });
}
}