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

  • SEARCH
  • Home
  • 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 8061409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:19:48+00:00 2026-06-05T10:19:48+00:00

In a firefox add-on, I would like to send an HTTPRequest to the URL

  • 0

In a firefox add-on, I would like to send an HTTPRequest to the URL of the button in this website: http://www.google.com/ads/preferences.
What I try to do is to get the form that contains the button and make an HTTP request to the action attribute (the goal is to get doubleclick cookies that the server sends if you do that). The problem is that when I get the form I get an XRayWrapper and I don’t know how to retrieve that attribute (I’ve already tried to do:

// unwrap is not available on older branches (3.5 and 3.6) - Bug 533596
if (XPCNativeWrapper && "unwrap" in XPCNativeWrapper) {
try {
  return XPCNativeWrapper.unwrap(thing);
} catch(e) {
  // Unwrapping will fail for JS literals - numbers, for example. Catch
  // the exception and proceed, it will eventually be returend as-is.
}
}

if (thing['wrappedJSObject']) {
return thing.wrappedJSObject;
}

Also, I’ve found that when I get the div with id=”content-pane” that contains the form and access to the innerHTML, I get an empty string. But It must be possible because I can view these contents with firebug, which is another add-on….

I’m really lost, thanks for your help!

EDIT: I’m using the add-on SDK, so I created a page worker to handle all this:

createDoubleClick: function() {
    new PageWorker.Page({
      contentURL: "http://www.google.com/ads/preferences",
      contentScriptFile: data.url('contentScripts/getCookie.js'),
      contentScriptWhen: "end",
      onMessage: function(message) {    
        console.log(message);                                   
      }                                       
    });                 
}

Then, in the contetScript I try to get the DOM:

// Get button 
var idPanel = "content-pane";

// Get content panel
var panel = document.getElementById(idPanel);

console.log(panel.innerHTML);

Result:

info: 
  • 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-06-05T10:19:51+00:00Added an answer on June 5, 2026 at 10:19 am

    The only scenario where you would want to remove that wrapper would be an extension that wants to interact with the JavaScript code of a web page – and even then it is doubtful whether you should do it. In this particular scenario you definitely shouldn’t do it. XrayWrapper (formerly known as XPCNativeWrapper) is a security layer meant to protect your extension. You can still access any DOM methods and attributes through it, just as you would do it normally:

    var url = form.getAttribute("action");
    

    If this call doesn’t return anything then most likely the action attribute simply isn’t set when you are trying to access it. You might need to wait longer, e.g. run your code in the load event handler rather than DOMContentLoaded (obviously, I don’t know what you are currently doing).

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

Sidebar

Related Questions

I would like to add a simple button to the Firefox interface: The button
I've created a jQuery UI button, and would like to add a 'X' secondary
In a Firefox add-on, I would like to set a temporary notification the top
I would like to add a menu button in the System bar of Android
I would like develop on add-on for Firefox , which combine with other available
After a successful login attempt my php script starts a session like this: session_set_cookie_params(1800,'/','www.mydomain.com',true);
I used to have a great Firefox add-on for this and I can't remember
I would like to add a hint value to my javax.swing.JTextField . It should
I would like to add some CSS fixed size blocks inline into a text
This is more like I would like to know why. The link buttons work

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.