title: No 'Access-Control-Allow-Origin' header is present on the requested resource. when running a Python script using Javascript
body: <p>I am new to AJAX and Flask and I am trying to make a Chrome extension that runs a Python script from Javascript. The script moves the mouse at a certain coordinate and clicks there.</p>
  <p>This is the Javascript code:
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function click_coord() {
      $.ajax({
          url: "http://127.0.0.1:5000/click_coord/",
          type: "POST",
          success: function(resp){
          console.log(resp);
      }
      });
   }</code></pre>
  </div>
  </div>
  </p>
  <p>This is the Python code:</p>
  <pre><code>from flask import Flask, jsonify
  from flask_cors import CORS, cross_origin
  from pynput.mouse import Button, Controller
  
  app = Flask(__name__)
  cors = CORS(app) 
  app.config['CORS_HEADERS'] = 'Content-Type'
  
  @app.route('/click_coord/', methods=['POST']) 
  def click_coord():
      move_mouse()
      a = 15
      b = 17
      return jsonify(a+b)
  
  def move_mouse():
      mouse = Controller()
  
      mouse.position = (201, 549)
  
      mouse.press(Button.left)
      mouse.release(Button.left)
  
  if __name__ == &quot;__main__&quot;:
      app.run(debug=True)
  </code></pre>
  <p>The error I get is: No 'Access-Control-Allow-Origin' header is present on the requested resource. I only get this error if I call the function &quot;move_mouse&quot;. If I don't, the code runs properly.</p>
  <p>I saw in another post that a person had a problem because they didn't add the correct permissions  but i added: &quot;permissions&quot;: [&quot;tabs&quot;, &quot;http://localhost/*&quot;] to the Json manifest</p>