Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7090835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:06:20+00:00 2026-05-28T08:06:20+00:00

I have problem with accessing Facebook graph. I am using a Greasemonkey script. When

  • 0

I have problem with accessing Facebook graph. I am using a Greasemonkey script. When I use the same script in chrome’s Tampermonkey it works well, and I can get data.

In Firefox nothing happens, I think maybe it’s because of cross-domain restrictions. Am I right, and is there a way this can be solved?

Forgot to mention, in Firefox only works if I am on graph.facebook.com.

edit:

var my_id = 1111111111;
var req = new XMLHttpRequest();
req.open('GET', 'https://graph.facebook.com/'+my_id, false); 
req.send();
var contents = req.responseText;
alert(contents);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:06:21+00:00Added an answer on May 28, 2026 at 8:06 am

    XMLHttpRequest does not support cross-domain requests. (You say this works in Tampermonkey though??!? Tampermonkey supports GM_xmlhttpRequest() so it might have extended cross-domain XHR to XMLHttpRequest(), maybe.)

    Nevertheless, to get this to work in Greasemonkey (and Chrome userscripts, and Tampermonkey), you need to use GM_xmlhttpRequest() — which allows cross domain requests.

    So the code from the question would become:

    var my_id = 1111111111;
    
    GM_xmlhttpRequest ( {
        method:         'GET',
        url:            'https://graph.facebook.com/' + my_id,
        onload:         function (responseDetails) {
                            var contents = responseDetails.responseText;
                            alert (contents);
                        }
    } );
    

    Note that GM_xmlhttpRequest() operates asynchronously. (It has a somewhat dicey synchronous mode but that is not recommended.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem accessing an intranet website with IE8. I can access the
I have problem accessing content from an Illustrator SWF(I create the swf using illustrator,
I have just noticed a problem accessing a CSS file using forms authentication from
I have a problem accessing the 'event' in Firefox. The following code works fine
I have a Problem accessing an Object function using this. In case of the
Hi all I have a problem with accessing an HashMap into my jsl using
I have a problem with accessing the graph API through my android application that
I have a problem accessing OpenAM SVN repository using Subclipse and was hoping that
I have a problem accessing JSON data. I'm new to JSON and jquery so
I am building my first ASP.Net MVC based app and have a problem accessing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.