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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:38:15+00:00 2026-06-11T08:38:15+00:00

I’ve made a simple NPRuntime plugin calls Javascript function when it loaded. Based example

  • 0

I’ve made a simple NPRuntime plugin calls Javascript function when it loaded.
Based example is seamonkey’s and it works fine on Google Chrome but it doesn’t on FireFox.

I traced code to find what is wrong and I found this line.

NPObject* window;
NPError err = NPN_GetValue(pNPP, NPNVWindowNPObject, &window);
if (!window)
    _log("Can not get DOM window %d", err);

err returns NPERR_INVALID_PARAM.

This simple example might work fine old version of Firefox I guess… 12.0? 13.0? (I’m not sure) Now I’m using FireFox 15.0 which is latest version.

Any help will be appreciated.

  • 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-11T08:38:16+00:00Added an answer on June 11, 2026 at 8:38 am

    So it looks like your real question is about how to call javascript stuff from another thread, since you can’t make NPN_ calls from other threads. The short answer is that you can’t; the longer, more complicated answer is that it’s a pain but it can be done.

    NPAPI has a function called NPN_PluginThreadAsyncCall. It accepts two parameters; the first is a function pointer that returns void and accepts a void*, and the second is the void* that will be passed to that function. You can call this function from any thread and it will cause your callback to be called back on the main thread “sometime soon”.

    The trick is to make sure that your void* gives you all the data you need to get back to whatever you need to access during that call. The bigger trick is to make this seem synchronous if that’s what you need. The first can be done with pointers and making sure you clean up after yourself; the second can be done with a mutex and a signal, if you’re clever.

    This is a tricky and difficult thing to get right. If it’s an option, you might consider using FireBreath because it does all of that for you. Particularly since FireBreath has workarounds for the various random browsers that don’t support NPN_PluginThreadAsyncCall (like some versions of Opera and Safari 5.1 and later).

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.