1

I am using kango extension to make cross browser plugin.
But I need to use part of native firefox sdk.
But I have a problem with following code:

var window = require('sdk/window/utils').getMostRecentBrowserWindow();

This doesn't work at all and doesn't print any error.
I added sdk folder from mozila sdk folder sdkx/lib/sdk.
I also have tried to move whole lib folder inside plugin but it doesn't work also.
I use native features from safari and chrome in the same way but only firefox requires this import of sdk.
What can I do to make this work?

1110
  • 7,829
  • 55
  • 176
  • 334
  • Try this: `var {Cu} = require('chrome'); Cu.import('resource://gre/modules/Services.jsm'); var window = Services.wm.getMostRecentWindow('navigator:browser');` if that doesnt work try `var {Cu: utils} = Components` in place of the first line – Noitidart Jun 01 '15 at 07:35

0 Answers0