An alias helps avoid relative import paths, which are more brittle than absolute
imports.
Also refactors utils.js to directly export functions instead of defining an
object.
Also refactors the sidebar to use a single product object as a prop.
The promise approach is cleaner, and now the retry code only tries a finite number of times before throwing a 'failure to connect' error. The interval between retries also doubles for each unsuccessful attempt.
Since there is no way to guarantee that the background script loads before a content script on web extension install (bug 1474727), I recursively try to connect until it goes through.
Since sidebar pages can be assigned per-tab, we can use query parameters to
store tab-specific data the sidebar needs, without having to deal with changing
the content of the sidebar when the user switches to different tabs.
Uses webpack to transpile sidebar.jsx into JavaScript to render the Sidebar component, which is currently a pure React component (i.e. stateless).
In addition to adding React and ReactDOM deps, I added the following devDeps:
* babel-core: Library to do the transpilation
* babel-loader: Enable transpiling using Babel via Webpack
* babel-preset-env: Compiles ES2015+ down to ES5
* babel-preset-react: Compiles JSX to JS
Facebook made a package (regenerator) that transpiled modern JS generators into older ES versions, and we don't need that, because Firefox supports modern JS generators. We're just going to disable that rule for now.
This looks for meta tags with a 'property' attribute with a value of 'og:*' to extract product title, image and price from a page by loading a content script, productInfo.js, into every page. This patch does not distinguish a product page from other kinds of web pages. The results are logged in the browser console by background.js.