Closed
Bug 1297703
Opened 8 years ago
Closed 8 years ago
Wrap page-metadata-parser/fathom.js in WKUserScript for extracting metadata from web pages
Categories
(Firefox for iOS :: General, defect, P1)
Tracking
()
RESOLVED
FIXED
Iteration:
1.5
People
(Reporter: sleroux, Assigned: sleroux)
References
Details
(Whiteboard: [MobileAS])
Attachments
(1 file)
Now that we know that we can run fathom.js locally by injecting it into the web context, we can start expanding on this to build a local metadata parser on iOS.
By using webpack, we're able to inline all of the node dependencies that fathom.js requires [1]. This inline also removes any traces of ES6 syntax - allowing the code to run in iOS's older Javascript context.
The next step will be to pull in :jkerim's page-metadata-parser ruleset that sits on top of fathom which defines extraction rules [2]. Combining these two should allow us to extract the meta data needed for Activity Stream uses.
We'll also need to load the Javascript through a WKUserScript object in a similar way we handle extracting favicons. By doing so, we'll be able to pass the extracted metadata from the web context into the native layer for storage and rendering on the A-S panel.
At this point, there are a few questions:
1. How do we want to persist this metadata? Should this live in our version of the places DB or in a separate cache?
2. Related to 1., how would we modify our existing queries and data layer to mix in meta data content for rendering top sites/highlights?
3. How does inlining all of the node/ES6 dependencies effect performance on page load? Webpacking fathom.js spits out 25k lines of Javascript which sounds like a lot to add on top of every page.
Finally, we've discussed whether we want to do this processing locally or through a web service. Considering that desktop has hopes of running it locally and the network constraints on mobile, running the extraction logic locally would be ideal.
[1] https://github.com/mozilla/fathom/pull/24
[2] https://github.com/mozilla/page-metadata-parser
Updated•8 years ago
|
Assignee: nobody → sleroux
Updated•8 years ago
|
Priority: P2 → P1
Updated•8 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•8 years ago
|
||
Broke out my DB work for this patch and kept this PR to just including the metadata parser and adding the plumbing in place. If you want to see the metadata being generated, place a breakpoint on the TODO line in Profile.swift!
Attachment #8791720 -
Flags: review?(bnicholson)
Comment 2•8 years ago
|
||
Comment on attachment 8791720 [details]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/2093#attch-to-bugzilla
LGTM!
Attachment #8791720 -
Flags: review?(bnicholson) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Iteration: --- → 1.5
You need to log in
before you can comment on or make changes to this bug.
Description
•