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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:27:49+00:00 2026-05-24T18:27:49+00:00

Since several days I am trying to resolve the folowing issue, reading all I

  • 0

Since several days I am trying to resolve the folowing issue, reading all I found around the web about npapi on mac.

The goal is to have a npapi plugin which works for safari and firefox(mac).
My software (that I can not rewrite specialy for this purpose hase about 45000 lines of C code) is based on a NSView attached to a NSDocument….

I have a webkit version based plugin that I must trash (thanks to Apple!) based to the same NSView.

I have a npapi version plugin which works fine on firefox. In this npapi plugin, I take the carbon window ref, I make a NSWindow based on that:
NSWindow *browserWindow = [[[NSWindow alloc] initWithWindowRef:wind]autorelease];

and I put my NSView on this window and that works.

Now the pb is that I can not do the same thing on safari.

Look at attached picture, the window is not in the safari’s window!
the firefox window is between safari's window and my plugin window

I tryed several ways… it dose not work.
Can a cocoa’s gourou says where I am making something wrong? or is this a known issue?

NPError NPP_SetWindow(NPP instance, NPWindow* window){

NP_CGContext *ctx = window->window;
void *wind = ctx->window;

…
in the NSView init function:

NSWindow *browserWindow = [[NSWindow alloc] initWithWindowRef:wind];
self = [super initWithFrame:frame];
if( self )
{
    [browserWindow makeFirstResponder: self];
    [self  setNextResponder: nil];
    [browserWindow setContentView:self];
    [self webPlugInInitialize];// my own initializing
}
return self;
  • 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-24T18:27:51+00:00Added an answer on May 24, 2026 at 6:27 pm

    In Safari 5.1, the web rendering is not done by Safari itself, but on a different process to enhance security. Open up the Activity Monitor, and you see that background process called “Safari Web Process” or something like that.

    So, you can’t and shouldn’t create NSWindow based on the Carbon window ref which can be obtained within NPAPI plugin.
    Read Apple’s own documentation on this point. You should request the core graphics drawing method, and then the WindowRef field of NP_CGContext should have a NSWindow*, not the Carbon window ref.

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

Sidebar

Related Questions

I've spent several days attempting to resolve this issue without success. The issue is
since several days I am trying to find a memory bug in my software.
I've been working in ASP.NET for several years now (since the 1.0 days!), but
I'm trying to store several 2D sprites inside a single texture, since I figured
Last several days I was trying to set up a proper local SVN (with
Since a few days, I have noticed on several, not related pages that a
This issue has been bugging me for the past several days. I've been working
Several days ago I had a question about removing index.php from the address bar,
I'm deseperatly trying to make the Admin Bundle For several days now, and I'm
I've been stuck since several days on my bluetooth application. Its role is to

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.