-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Google Chrome Extension #512
Support for Google Chrome Extension #512
Conversation
DeepCode's analysis on #8b7fd2 found:
💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues. |
Hey @AndrewBastin, TravisBuddy Request Identifier: b1523290-3cb6-11ea-b9f2-e91196c7ff19 |
Hey @AndrewBastin, TravisBuddy Request Identifier: a6a7c600-3cbd-11ea-b9f2-e91196c7ff19 |
@AndrewBastin How to detect Chrome extension bg activity as in Firefox? |
The way Chrome has implemented extensions, code is segregated into 3 separate worlds (extension background script, extension content script and the page script), none can exactly access or query the other directly. We can't use the same trick by detecting injected properties as in Firefox due to the above mentioned segregation rule. So, inorder for detection in Chrome, the extension adds an empty span to the Postwoman page body with ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make use of relative imports for the sake of consistency.
Co-Authored-By: James George <jamesgeorge998001@gmail.com>
Hey @AndrewBastin, TravisBuddy Request Identifier: 709701c0-3d3f-11ea-a8ac-8912d21a789c |
Hey @AndrewBastin, TravisBuddy Request Identifier: 6d4d06e0-3d3f-11ea-a8ac-8912d21a789c |
@AndrewBastin
|
@liyasthomas seems like a buildscript issue in Windows, sorry for not catching that, I don't use Windows that often. I will fix that soon. Can you report if running the following command separately works:
The first command runs the parcel bundler to generate the code in the dist folder. So, if you want to test, you could also copy the content manually for now. |
Hey @AndrewBastin, TravisBuddy Request Identifier: 59945950-3d94-11ea-8d60-2f6c30a51d00 |
These does'nt work 👎 : These woked 👍 : |
Ohkay, I will update it on the buildscript. Denks. Opening up Windows sucks 🤣 |
Okay, so I have updated buildscript in the postwoman-chrome repo. Should fix all the issues in Windows now. |
Works like charm 🎉 |
…install prompt toast
@AndrewBastin ready to be merged? |
@liyasthomas yup. |
Hey @AndrewBastin, TravisBuddy Request Identifier: 5dcb2760-3da3-11ea-8d60-2f6c30a51d00 |
This PR intends to introduce compatibility with Postwoman Chrome Extension
This adds a new NetworkStrategy to hook with the Chrome Content Script and Background Script to run the query.
NOTE
Do NOT use the extension from the store to test the strategy, because, the extension is configured to only hook into the
postwoman.io
andpostwoman.netlify.com
domains. Other domains won't get hooked and hence won't get access to the extension hooks.So, to test this PR, you have to clone the postwoman-chrome repo.
Then head into the
manifest.json
file and edit it to match this snippet belowThen run
npm install
and thennpm run build
.This will create a folder called dist with the generated code.
Then, open Chrome and navigate to
chrome://extensions
, click onLoad Unpacked
and then select the generated dist folder.Next, go to your postwoman cloned repo and open the file
functions/strategies/ChromeStrategy.js
and editEXTENSION_ID
constant to match with the extension ID you got while loading our Unpacked Extension in the prior step (to find it, just click on the extension details of our extension).The defined
EXTENSION_ID
is for the extension in the Chrome Web Store.After this you can navigate to the Postwoman app in localhost and access it, you can check if the hook was successful or not by opening the console on the Postwoman app and checking for the console log "Connected to the Postwoman Chrome Extension!" after load.
Once that is done, just fire a request anywhere and you will see that CORS restrictions won't be applied.
NOTE: The Chrome extension isn't marked public yet in the Chrome Web Store, it will be marked public as soon as this PR is approved