Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Michael Kelly 217f6f24ad
Use alias for imports and refactor sidebar.
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.
2018-07-20 13:14:26 -07:00
Michael Kelly a4bfc5ed11
Merge pull request #22 from mozilla/page-action
Fix #14: Show page action when we detect a product.
2018-07-16 12:04:14 -07:00
Michael Kelly d8c72314e7
Fix #14: Show page action when we detect a product. 2018-07-13 13:09:48 -07:00
Michael Kelly 58c41302a9
Merge pull request #18 from mozilla/17-ports
Open port between background and content script. Fixes #17.
2018-07-13 12:57:43 -07:00
Michael Kelly 17c9c7de5e
Minor doc comment tweaks. 2018-07-13 12:53:58 -07:00
Bianca Danforth 75e9a1f748 Make comments more JSDoc-like.
Also changed the units for the default value for initialDelay in the retry method of utils.js to milliseconds.
2018-07-13 11:27:16 -07:00
Bianca Danforth 13c478c356 Incorporate more of Osmose's feedback. 2018-07-13 11:27:16 -07:00
Bianca Danforth a4fe7941bd Incorporate feedback from Osmose.
Created a 'utils.js' file that is imported into the content script 'product_info.js'. These are now bundled by webpack into a single script.
2018-07-13 11:27:16 -07:00
Bianca Danforth bb1c30c7ad Rewrite fix to use promises and improve connection retry code.
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.
2018-07-13 11:27:16 -07:00
Bianca Danforth e01fbc8202 Open port between background and content script. Fixes #17.
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.
2018-07-13 11:27:16 -07:00
Michael Kelly 5fa4ebcedc
Merge pull request #20 from mozilla/sidebar-price
Fix #13: Display extracted product data in the sidebar.
2018-07-12 18:38:31 -07:00
Michael Kelly 39b26ce56a
Fix #13: Display extracted product data in the sidebar.
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.
2018-07-12 18:35:28 -07:00
Michael Kelly 7ba5aa7c86
Fix formatting in license block. 2018-07-10 22:58:26 -07:00
Michael Kelly d3ec04c80a
Use inline source maps.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1437937#c4 for why external
source maps don't work with extensions.
2018-07-10 22:55:50 -07:00
Michael Kelly fc22fe05a0
Merge pull request #11 from mozilla/react-sidebar
Add React to sidebar in web extension.
2018-07-10 09:17:31 -07:00
Bianca Danforth 9300a061da Incorporate feedback from osmose. 2018-07-09 16:56:41 -07:00
Bianca Danforth 7dafaa8ab9 Add React to sidebar in web extension.
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
2018-07-06 18:30:12 -07:00
Michael Kelly dfa310c4e3
Merge pull request #10 from mozilla/circle
Get CircleCI running and passing
2018-07-06 16:17:04 -07:00
Michael Kelly fa3c3160f9
Package extension before storing artifacts. 2018-07-06 16:13:19 -07:00
Michael Kelly 79b007f9f6
Include product_info.js (renamed) in built add-on. 2018-07-06 10:10:13 -07:00
Michael Kelly 22278f1d2e
Rename CircleCI directory and fix config problems. 2018-07-06 10:05:58 -07:00
Michael Kelly 56d85f4b8d
Add webpack as a build tool.
We plan on using React/JSX in the future, so webpack is almost a given.
2018-07-06 10:04:32 -07:00
Bianca Danforth 7ab218722e
Merge pull request #6 from mozilla/open-graph
Add initial Open Graph product recognition.
2018-07-06 09:59:34 -07:00
Bianca Danforth 6ab7d19d5e Rebasing on top of eslint PR#2.
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.
2018-07-06 09:58:40 -07:00
Bianca Danforth 77e662d7b8 Apply some fixes per osmose's feedback. 2018-07-05 15:52:11 -07:00
Bianca Danforth c9c8f6485a Add initial Open Graph product recognition.
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.
2018-07-05 15:52:11 -07:00
Michael Kelly 6f1a7582cd
Merge pull request #2 from Osmose/eslint
Add eslint and rearrange code
2018-07-05 11:30:11 -07:00
Michael Kelly 0eeb00cddb
Add eslint for linting. 2018-07-05 11:29:26 -07:00
Michael Kelly 178fbc4a32
Move extension sources to src. 2018-07-02 16:48:04 -07:00
Michael Kelly ca787f111c
Merge pull request #3 from Osmose/fix-toolbar
Fix incorrect sidebar code.
2018-07-02 16:37:03 -07:00
Michael Kelly 457a8aea2a
Fix incorrect sidebar code. 2018-07-02 16:27:29 -07:00
Michael Kelly 77e4fa2b93
Merge pull request #1 from Osmose/initial-scaffolding
Add basic scaffolding for a sidebar extension, README, etc.
2018-06-29 15:45:02 -07:00
Michael Kelly 4c54a5e172
Add basic scaffolding for a sidebar extension, README, etc. 2018-06-29 15:44:40 -07:00
Michael Kelly 88e804674c
Initial commit. 2018-06-27 21:01:13 -07:00