• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Chrome Development Help

Status
Not open for further replies.

BlueMagic

Member
I'm needing help with developing an extension for Chrome (total newbie here), so in order to stop derailing the Chrome Thread, I created a new one.

To start off:
As I said in the other thread, I want to build an extension for a vBulletin forum. I'm trying to make it show more posts than the current max limit (which is very low), and I have already made some advances. However I found a problem. See this code that belongs to the extension code:

Code:
var url = document.location.href;
alert (url);

function successFunction(data) {
		alert('success');
		//code to append posts
};

function errorFunction(data){
	alert('error');
};

$(document).ready(function() {
	alert('loading');
	$.get(url).success(successFunction).error(errorFunction);
});

I'm using the latest version of jquery (jquery-1.7.1.min.js). It always fails (ends up alerting 'error') and I can't seem to know why. Without getting this right I can't get to the relevant part of the extension which would be actually appending more posts. Any help?

The manifest file is this, which I assume is correct:

Code:
{
  "name": "extensiontest",
  "version": "0.1",
  "description": "get more ppp",
  "browser_action": {
   // "default_icon": "icon.png"
  },
  "permissions": ["http://foros.3dgames.com.ar/*"],
  "content_scripts": [
    {
      "matches": ["http://foros.3dgames.com.ar/*"],
      "js": ["jquery-1.7.1.min.js","communication2.js"]
    }
  ]
}

EDIT: also tried window.location instead of document.location and it still fails.
 
If you open the Chrome Developer Tools and go to the console tab, are you seeing any errors like:

Code:
XMLHttpRequest cannot load ____________ Origin null is not allowed by Access-Control-Allow-Origin.

?
 
If you open the Chrome Developer Tools and go to the console tab, are you seeing any errors like:

Code:
XMLHttpRequest cannot load ____________ Origin null is not allowed by Access-Control-Allow-Origin.

?

Nope.

EDIT: Well what do you know, I restarted Chrome and it worked. Damn, I swear to god I tried everything (Reloaded the extension many times and everything went fine but it just wouldn't work) . lol, well I'll probably be asking a couple of questions on actually trying to get more posts to appear, thanks for the help guys!
 
Status
Not open for further replies.
Top Bottom