Closed
Bug 1326321
Opened 8 years ago
Closed 8 years ago
Page Metadata parser's babel pollutes global namespace. Breaking websites
Categories
(Firefox for iOS :: Browser, defect, P1)
Tracking
()
RESOLVED
FIXED
Iteration:
1.15
People
(Reporter: farhan, Assigned: farhan)
References
(Blocks 1 open bug)
Details
(Whiteboard: [mobileAS])
The page-metadata-paser will add babel to global._babelpollyfil. If a site also uses babel this will break that site as it won't be able to add its own version of babel pollyfil to global.
In the console you should see this error
"only one instance of babel-polyfill is allowed"
You can test this on the mobile version of reddit.com with the page-metadata-parser enabled. You'll see that no content on the page loads. And in the js console the above error will be shown.
Any thoughts on how we can get around this?
Assignee | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
James had suggested that we find a way to maybe convert the page-metadata-parser/fathom.js stuff to not have to use babel.js. Since MobileSafari supports some ES6 features this might not be that big of a change.
Assignee | ||
Comment 2•8 years ago
|
||
We might be able to avoid using babel if we were on iOS10 only. But there is a lot of missing functionality on iOS9 https://kangax.github.io/compat-table/es6/#ios9
Assignee | ||
Comment 3•8 years ago
|
||
We could try moving it into a webworker. Similar to what I attempted with Readability. https://github.com/mozilla-mobile/firefox-ios/pull/2299
We'll need to create a new dom with JSDOM to pass to fathom.
Comment 4•8 years ago
|
||
Farhan,should this be in our MVP list? Just double-checking before I set to P2
Flags: needinfo?(fpatel)
Assignee | ||
Comment 5•8 years ago
|
||
Yea it should be. I can do that.
Flags: needinfo?(fpatel)
Priority: -- → P2
Assignee | ||
Comment 6•8 years ago
|
||
I can get around this by using babel-transform-runtime.
Assignee: nobody → fpatel
Assignee | ||
Updated•8 years ago
|
Iteration: --- → 1.14
Priority: P2 → P1
Updated•8 years ago
|
Iteration: 1.14 → 1.15
Assignee | ||
Comment 7•8 years ago
|
||
I was able to fix this by using babel-transform you can see the changes I made to the webpack config here in my fork of the metadata parser repo https://github.com/mozilla-mobile/page-metadata-parser
https://github.com/mozilla-mobile/firefox-ios/pull/2424/commits/ca3c44dc81181a0688238d67d48e89305b3738af
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•