Google Extension issue xhr request

Failed to show response data but status still (200 OK)

Here is images
Looks like request still normal

enter image description here

But problem with response data :/

but still problem with data

call a function in content script when a jquery ajax call is made from a web page

I want to call a function in content script java script page when a jquery ajax call is made in a web page. I tried using $(doc).ajaxComplete() function in the content script page but it is not getting called when an ajax call is made from web page . But when an ajax call is made from content script page the .ajaxComplete() is working

How to catch AJAX response with webRequest Api?

I tried in and But i can’t catch url. Because url type’s not main_frame. I want to get referrer information of the pages. But I can’t do this in AJAX redirect. Do you have any solution for this?Please give me an opinion of positive or negative.

Load AJAX from within a Chrome extension

I tried several methods to achieve this, including adding permissions.
Here is my Manifest.json:

  "manifest_version": 2,
  "name": "name",
  "version": "0.8",
  "permissions": [
   "content_scripts": [
      "matches": [
      "js": ["jquery.min.js", "content.js"],
      "run_at": "document_end"
  "background": {

    "page": "background.html"
  "browser_action": {
    "default_icon": "icon.png",
     "default_popup" : "Popup.html"
  "permissions": [
"content_security_policy": "script-src 'self'; object-src 'self'"


// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

 * Get the current URL.
 * @param {function(string)} callback - called when the URL of the current tab
 *   is found.
function getCurrentTabUrl(callback) {
  // Query filter to be passed to chrome.tabs.query - see
  var queryInfo = {
    active: true,
    currentWindow: true

  chrome.tabs.query(queryInfo, function(tabs) {
    // chrome.tabs.query invokes the callback with a list of tabs that match the
    // query. When the popup is opened, there is certainly a window and at least
    // one tab, so we can safely assume that |tabs| is a non-empty array.
    // A window can only have one active tab at a time, so the array consists of
    // exactly one tab.
     tab = tabs[0];

    // A tab is a plain object that provides information about the tab.
    // See
     url = tab.url;
     fixedURL = url;
     fixedURL = url.substring(1);

    // Open the page up.

    // tab.url is only available if the "activeTab" permission is declared.
    // If you want to see the URL of other tabs (e.g. after removing active:true
    // from |queryInfo|), then the "tabs" permission is required to see their
    // "url" properties.
    //console.assert(typeof url == 'string', 'tab.url should be a string');


  // Most methods of the Chrome extension APIs are asynchronous. This means that
  // you CANNOT do something like this:
  // var url;
  // chrome.tabs.query(queryInfo, function(tabs) {
  //   url = tabs[0].url;
  // });
  // alert(url); // Shows "undefined", because chrome.tabs.query is async.

 * @param {string} searchTerm - Search term for Google Image search.
 * @param {function(string,number,number)} callback - Called when an image has
 *   been found. The callback gets the URL, width and height of the image.
 * @param {function(string)} errorCallback - Called when the image is not found.
 *   The callback gets a string that describes the failure reason.

function loadXMLDoc()
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)

document.addEventListener('DOMContentLoaded', function() {
  getCurrentTabUrl(function(url) {



    }, function(errorMessage) {


The relevant part of the answer we get after clicking the extension:

      email = $('#scannedinfo-email').val();
      emailval = validateEmail(email);
      if(emailval != false){
          email: $('#scannedinfo-email').val(),
          message: $('textarea').val()
          //do stuff
      } else{
        //do stuff


When I open the url that I do the AJAX call to in a browser, it works fine. When I check in the extension nothing seems to happen. No errors or anything.
What could the issue be?
Any ideas?

Thanks in advance!

How to check if the current website in your browser is a phishing site by checking into the database of Phishtank using JSON and Ajax

I want to create a Google chrome extension that detects phishing sites by checking the site in the database of Phishtank. How do I go by the JavaScript codes using JSON and Ajax?

How to send ajax call in chrome extension?

I am a newbie and working on a google-chrome extension, that needs to make jquery ajax requests to a server, load some json objects,But ajax call not run successfully , please guide me, thanks in advance

Find source of ajax call to

My WordPress installation has mysteriously begun to stop applying some layout fixes and I suspect that it has something to do with a mysterious GET request that I’m trying to hunt down:

enter image description here

I’m guessing that I’m assembling the url, with a variable that I fail to assign a value and is thus evaluated as “undefined”. My question is, where is this happening.

When I click the link to “undefined:1” on the right, it takes me to a list of images and displays the markup for my site’s 404 page:

enter image description here

How can I isolate the place on my site where the GET request is being made?

Chrome Extension Inject HTML on YouTube Page [duplicate]

This question already has an answer here:

I am creating a Chrome Extension that will inject HTML on top of the related videos bar of a YouTube video.

This is the desired effect of the plugin.

Here is the manifest.json:

  // Required
  "manifest_version": 2,

  // App
  "name": "...",
  "version": "...",
  "author": "...",
  "description": "...",

  "content_scripts": [
      "run_at": "document_idle",
      "matches": ["*://*"],
      "js": ["jquery-min-3.3.1.js", "inject.js"]


And here is inject.js:


This was injected throught jQuery.

'); });

When the extension is loaded into Chrome and a YouTube video page is loaded, the script seems to work for a second. The h1 in injected at the top of the #related bar until related video thumbnails start to load. Then the injected h1 quickly is pushed to the bottom as each new thumbnail loads.

I’m guessing this has something to do with YouTube using AJAX to load content. Is there a way to wait until all AJAX has been loaded before injecting HTML?

Ajax on Chrome Extension Uninstall

I need to run an AJAX query to clean up my database when my Chrome extension is uninstalled. The function is for all installed extensions and I don’t want to create a solution that uses it because it requires a special permission.

How do I detect when only my extension is uninstalled.

Chrome.runtime.connect no longer identified?

I have an extension with a background page and a sandbox page where most of the content scripts execute.

Whenever I need to do an Ajax call it has to run in the background environment as otherwise I get a CORS error. Recently as of last week I believe, the chrome.runtime is no longer available in the sandbox environment for some reason. I can’t find any notes etc about it and trying to figure out a solution how to communicate with background page now.

I had this in the sandbox environment to initialize a connect port to pass messages from an Ajax request

var ajaxCall = chrome.runtime.connect({name: "ajaxCall"});

Is there any info out there that I’m missing on why this change occurred and what are some possible workarounds?

Here’s the output for chrome. 1st is the background page and 2nd is the sandbox. They used to be identical in both.