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 7059121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:11:39+00:00 2026-05-28T04:11:39+00:00

I create a firefox addon with the online addon builder. How can one use

  • 0

I create a firefox addon with the online addon builder. How can one use an existing function on a webpage, from within the addon? This site doesn’t belong to me, so I can’t bind event listeners, in order to send an event to it from my addon.

Update: Now I have this code but it doesn’t work:

main.js

var widgets = require("widget");
var tabs = require("tabs");
var data = require("self").data;


var widget = widgets.Widget({
  id: "transfer",
  label: "Transfer",
  content: "Transfer",
  width: 100,
  onClick: function() {
    tabs.activeTab.attach({
      // native implementation of window.confirm will be used
      contentScriptFile: data.url("new.js")
    });
  }
});

new.js:

function foo()
{
    call(); // function in webpage

}
unsafeWindow.foo();
  • 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-28T04:11:40+00:00Added an answer on May 28, 2026 at 4:11 am

    You inject a content script into the page (e.g. via page-mod package) and call unsafeWindow.foo() in the content script to call function foo() from the content script. See documentation for more information. Please make sure to read the warnings: you are relying on the web page function to behave the way you expect but it might not. In particular, if the function returns something and you want to process that result, you might inadvertently introduce a security hole.

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

Sidebar

Related Questions

While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
For reasons that only the developers can understand, Firefox will create and open .url
how can i create an application to read all my browser (firefox) history? i
Is it possible to create Selenium tests using the Firefox plugin that use randomly
I have this authnav='<li class=last><a href=auth/login>login</a></li>'+ '<li><a href=auth/create_account>create account</a></li>'; It works fine in Firefox,
I'm trying to create a conditional overlay for firefox's new addon manager in minefield
How can I create a shortcut for Greasemonkey for the firefox bookmarks, or, a
This happens in Firefox, but not in Google Chrome. I create an SVG 'Image'
I'm trying to create an xpi package for a firefox addon through cfx tool.
I am trying to create a Firefox extension that can run multiple XMLHttpRequests per

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.