Git Product home page Git Product logo

Comments (5)

fregante avatar fregante commented on August 14, 2024

I tried in a separate branch (b9d689d), I don't know what's up with this:

XMLHttpRequest cannot load http://localhost:4001/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://ofpkoojilefiajcbecnomfaiemdjhpbn' is therefore not allowed access.

Why do you think this is happening?

from ghosttext-for-chrome.

Cacodaimon avatar Cacodaimon commented on August 14, 2024

I got the same error when setting using "activeTab". It seems that chrome handles the background.js in another way, where the background.js scripts acts as a part of the content script, when using this option. Since a HTTP server does net sends a asterisks CORS header by default this error is the same when doing an normal ajax request with another url not matching the site delivering URL.

Maybe a chrome bug or is the documentation here https://developer.chrome.com/extensions/activeTab is poor?

from ghosttext-for-chrome.

fregante avatar fregante commented on August 14, 2024

activeTab is not the issue, that permission is in the master branch and it works; chrome.tabs.executeScript is. I think it somehow messes something up, it does look like a bug. :(

from ghosttext-for-chrome.

fregante avatar fregante commented on August 14, 2024

Of course the bug was in my head. I didn't RTFM. The only problem was that the content script had the permission to access all sites, but executeScript required that permission anyway in the permissions parameter. So this fixed it

"permissions": [
    "activeTab", "http://localhost/"
],

from ghosttext-for-chrome.

fregante avatar fregante commented on August 14, 2024

Current permission screen:
Permissions screen

from ghosttext-for-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.