Skip to content
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

Firefox Extension compatibility #494

Merged
merged 3 commits into from Jan 16, 2020

Conversation

AndrewBastin
Copy link
Member

@AndrewBastin AndrewBastin commented Jan 16, 2020

This PR intends to introduce compatibility with Postwoman Firefox Extension

This adds a new NetworkStrategy to hook with the Firefox Content 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 and postwoman.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-firefox repo.

Then head into the manifest.json file and edit it to match this snippet below

 "content_scripts": [
    {
      "matches": [
        "*://*/*",
        "https://postwoman.io/",
        "https://postwoman.io/*",
        "https://postwoman.netlify.com/*",
        "https://postwoman.netlify.com/"
      ],
      "js": [ "index.js" ]
    }
  ],

Then run npm install and then npm run build.
NOTE: npm run build may fail on non-Unix compliant systems as it uses the cp command, if it fails, just copy the icons folder and the manifest.json to the dist folder

This will create a folder called dist with the generated code.

Then, open Firefox and navigate to about:debugging, select This Firefox and the click on Load Temporary Add-on... and then select the manifest.json file in the generated dist folder.

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 log "Connected to the Postwoman Firefox Extension!" after load.

Once that is done, just fire a request anywhere and you will see that CORS restrictions won't be applied.

@ghost
Copy link

ghost commented Jan 16, 2020

DeepCode's analysis on #aafb4d found:

  • 0 critical issues. ⚠️ 0 warnings and 0 minor issues. ✔️ 0 issues were fixed.

💬 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.


☺️ If you want to provide feedback on our bot, here is how to contact us.

@AndrewBastin AndrewBastin self-assigned this Jan 16, 2020
@AndrewBastin AndrewBastin added core Changes regarding core concepts feature New feature or request labels Jan 16, 2020
@AndrewBastin AndrewBastin added this to the v2.0 milestone Jan 16, 2020
@TravisBuddy
Copy link

Hey @AndrewBastin,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 2c66d440-387f-11ea-b5ea-ed59922799f5

@TravisBuddy
Copy link

Hey @AndrewBastin,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 87996960-3887-11ea-b5ea-ed59922799f5

@AndrewBastin AndrewBastin merged commit 7c53055 into hoppscotch:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes regarding core concepts feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants