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 |
jamesgeorge007
left a comment
There was a problem hiding this comment.
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.ioandpostwoman.netlify.comdomains. 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.jsonfile and edit it to match this snippet belowThen run
npm installand thennpm run build.This will create a folder called dist with the generated code.
Then, open Chrome and navigate to
chrome://extensions, click onLoad Unpackedand then select the generated dist folder.Next, go to your postwoman cloned repo and open the file
functions/strategies/ChromeStrategy.jsand editEXTENSION_IDconstant 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_IDis 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