Register NPAPI Plugins - npapi

i try to register an own NPAPI Plugin, but i dont found informations about that.
I know that the NPAPI on Chrome is deprecated (i will write a PPAPI Plugin later) but Chrome-Docs says that i must use a manifest.json (See https://developer.chrome.com/extensions/npapi). But how i register it?
Following i had try:
Over an BATCH-File (register.bat):
regsvr32.exe /s "C:\Users\Bizzi\Desktop\WoRPG Plugin\npworpg\Release\npworpg.dll"
pause
Directly in the Registry:
HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\
[worpg.de/WoRPG]
Description REG_SZ World of RPG Browser Plugin
Path REG_SZ C:\Users\Bizzi\Desktop\WoRPG Plugin\npworpg\Release\npworpg.dll
ProductName REG_SZ World of RPG Plug-In
Vendor REG_SZ World of RPG
Version REG_SZ 1.0.0
[MimeTypes]
[application/x-worpg-launcher]
Description REG_SZ World of RPG

The solution is very simple!
Be sure what the depency the browser have. If the browser an 64bit based browser, be sure that the registry entry is set:
Chrome (32bit): KEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions
Chrome (64bit): KEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions
Firefox (32bit): KEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins
Firefox (64bit): KEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins
Here is a little .reg script:
Windows Registry Editor Version 5.00
; MOZILLA 32bit
[HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\#worpg.de/npworpg,version=1.0.0]
"Description"="World of RPG Browser Plugin"
"Path"="C:\\Program Files (x86)\\World of RPG\\plugins\\npworpg.dll"
"ProductName"="npworpg"
"Vendor"="World of RPG"
"Version"="1.0.0"
[HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\#worpg.de/WoRPG,version=1.0.0\MimeTypes]
[HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\#worpg.de/WoRPG,version=1.0.0\MimeTypes\application/x-worpg-launcher]
"Description"="World of RPG"
; MOZILLA 64bit
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\#worpg.de/npworpg,version=1.0.0]
"Description"="World of RPG Browser Plugin"
"Path"="C:\\Program Files (x86)\\World of RPG\\plugins\\npworpg.dll"
"ProductName"="npworpg"
"Vendor"="World of RPG"
"Version"="1.0.0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\#worpg.de/WoRPG,version=1.0.0\MimeTypes]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\#worpg.de/WoRPG,version=1.0.0\MimeTypes\application/x-worpg-launcher]
"Description"="World of RPG"
; CHROME 32bit
[HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\ckpknilfoflolaglllnonhhhnfhaidom]
"Path"="C:\\Program Files (x86)\\World of RPG\\plugins\\npworpg.dll"
"Version"="1.0.0"
; CHROME 64bit
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\ckpknilfoflolaglllnonhhhnfhaidom]
"Path"="C:\\Program Files (x86)\\World of RPG\\plugins\\npworpg.dll"
"Version"="1.0.0"

You are relatively close, from the looks of things. The documentation shows that you have incorrectly formed your plugin identifier, however, which should start with a #.
Hard to be 100% sure if that's the only issue, but it's the one I see.
KEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\
[#worpg.de/WoRPG]
Try that, see what happens.

Related

Autohotkey: Identify Google Chrome vs Google Chromium

I can't seem to figure this out
On autohotkey, there's documentation on how to identify a window / program running.
Google Chrome and Google Chromium both use the same ahk_class and the same .exe name of chrome.exe
How does one use something like winTitle or winGet to distinguish the difference? I tried looking into PID values but they don't seem to be consistent.
EDIT via WinSpy++
Using winspy++, I ran a simple experiment. 2 Chromium Windows and 2 Chrome Windows so I can have a control group. Differences:
INSTANCE HANDLE: Chrome shows 0F2C0000, Chromium shows A2820000
Process ID: Chrome shows 00003528 (13608), Chromium shows 00001B74 (7028)
Thread ID: Chrome shows 00003524 (13604), Chromium 00000220 (544)
In this case you have two possibilities to distinguish between the two programs:
(1) Using SetTitleMatchMode 2 and the part of the title that all windows of this program have in common:
SetTitleMatchMode 2
If WinExist("- Chromium")
WinActivate
(2) Using "ahk_exe Path":
If WinExist("ahk_exe full_path_of_the_executable_chrome.exe")
WinActivate
To get the full path of the active window process use this:
F1::
WinGet, Path, ProcessPath, A
MsgBox, %Path%
return
Using Windows Spy (came with autohotkey). Is not the same as winspy++
To access Windows Spy found here:
Differences are found in WinTitle

Failed to load csb file in xcode

I have a game source code which previously has been submitted to app store. for now i am going to resubmit it with better performance but have been faced weird issue. there are already .csb files for each scene in the source code. i have googled and understood how i have to use cocos studio 2.0. for testing purpose i opened old cocos studio project file (.css) and republished it with no changes. and then copy from res folder and paste it into resource folder. but when the xcode tried to load .csb file it crashed.
mainLayer = (Layer*)CSLoader::createNode("GameScene.csb");
the source code works fine with old .csb file. but not worked with new one.
xcode gave me no correct reason. I can see only some setting values in debugger view like this.
when i tried with new .csb which i've republished
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
suffix = csb
textureSize = 7
no more
when i tried with old .csb from old source code
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
suffix = csb
textureSize = 0
many more...
as you can see, with new one, the app crashed after printed textureSize.
i am using cocos2dx v3.3 and cocos studio v2.2.1
could you please explain about how should i avoid this issue?
many thanks.
Libpng-1.6 is stricter than older versions about bad ICC sRGB profiles.
There is a new C function that you can call to skip the sRGB profile checking:
png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON);
If you're not using C you'll need to find out the equivalent way of doing that.
They are just warnings. A more permanent, and better, solution if you own the image files is to fix the PNG files by removing the bad ICC profiles, which are contained in the PNG iCCP chunk, using your favorite PNG editor.
Having an sRGB profile in an iCCP chunk is just bloat anyway, because applications will assume the image is in the sRGB colorspace if there's no ICC profile present.
It has nothing to do with libpng warning.
This problem may be because some versions of cocos2d-x and cocostudio are not compatible to each other
Update both cocostudio and cocos2d-x to latest version.
try to put the in AppDelegate.cpp the addSearchPath, for example
if you have the .csb files in Resource/cocosstudio add this on applicationDidFinishLaunching() function :
FileUtils::getInstance()->addSearchPath("cocosstudio");
In my proyect i call it like this:
auto node = CSLoader::createNode("MainScene.csb");

phpstorm unresolved function or method $()

I have the following problem: phpstorm do not recognize jquery methods and here and there I see
Unresolved function or method $()
This was bugging me for sometime but finally I tried to get rid of it with File->Settings->JavaScript->Libraries and adding jquery as a global / project.
My library setup looks like this:
But is has not changed anything. I still see those pesky notices. Does anyone know how to get rid of them?
There is a really stupid workaround,
Download the Library (in this case jQuery) from inside the IDE itself.
Open up settings (Ctrl + Alt + S on Linux)
Navigate to Languages & Frameworks -> Javascript -> Libraries
Click Download and choose jQuery
Hopefully the errors will vanish
EDIT:
After running the IDE through Fiddler, I realised this only solves the problem because of the version the IDE downloads.
So, the correct workaround is to Add older, non-AMD jQuery versions as a Global scoped Library and add the latest one as a Project scope library.
The latest non-AMD versions are:
1.10.2 for 1.x series. And, 2.0.0 for 2.x series.
I had the same issue with version 1.11.2, and resolved it simply by adding the uncompressed version into my js folder.
Just copy the uncompressed version of jQuery into your project folder.
you don't even need to import it into your project, just copy it to javascript folder.
The jQuery v1.11.0 shows exactly the same behaviour here as well. At the same time previous version 1.10.2 works fine in IDE (no warnings).
I think it has something to do with "AMD-fy jQuery source" ticket (http://bugs.jquery.com/ticket/14113) -- looks like IDE has some issues figuring out this style.
If you wish (and can) -- roll back to jQuery v1.10.2 (which is like half a year old, which means it's stable and still good to use).
Hopefully IDE will be able to properly parse this new jQuery style in next release.
Actual ticket: http://youtrack.jetbrains.com/issue/WEB-10908
If you import both 1.11.0 and 1.10.2 in phpstorm it will be resolved
You don't have to rollback your project.

How do I use phalcon-devtools\ide\phpstorm in phpstorm?

I am trying to integrate the Phalcon developer tools with phpstorm. There is a video here, but I am unable to view it due to my location.
I can't find any other usable reference in the documentation, how can I accomplish this?
Here are the steps.
Make sure you have the phalcon-devtools installed Instructions
Create a project using phalcon-devtools (unless you already have a project)
Launch PHPStorm and create the project there (unless you already did that).
Click File-Settings (Ctrl+Alt+S) (or PHPStorm-Preferences for Mac)
Click the second option "Command Line Tool Support"
Click the + icon and a new popup comes up. Make sure you have "Custom Framework" selected
In the new popup type:
Framework: Phalcon
Tool path: /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/phalcon.sh
Alias: phalcon
Description: Phalcon Developer Tools
This assumes that your phalcon-tools have been installed under:
/Applications/MAMP/htdocs/phalcon-tools/
Also if you use a Windows environment, you should use phalcon.bat instead of phalcon.sh (see Tool Path line above)
Click Apply and then OK.
Click Tools - Run Command (Ctrl+Shift+X)
In the Commands output window, type:
phalcon commands
You should be able to see output. If there is an error check your path. Type any of the phalcon-tools commands to generate components for your project.
In PHPStorm you should see in the project explorer "External Libraries". Right mouse click and select "Configure PHP Include Paths"
In the new dialog click the + and navigate to the /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/0.5.0 folder and click OK.
Now as you type code, the relevant helper popup will appear with all the relevant functions.
2012-09-07: There is a beta implementation of the Phalcon PHPStorm support for 0.5.0 here. In the upcoming weeks the code will become part of the framework and included with the 0.5.0 version.
I had some problems with the execution of the phalcon.bat file on my Windows Dev machine, no PHP installed, so i research a much simpler solution for phpstorm.
Simply do following:
click on "External Libraries"
click on "Configure PHP Includes Paths..."
click on add
add "phalcon-devtools\ide\[YOUR_VERSION_DIRECTORY]"
Than you have code completion for phalcon:-)
If you see the Phalcon module loaded in phpinfo page in your WAMP server, do the following to get loaded the module in CLI mode too.
Copy <WAMP INSTALATION >\bin\apache\<APACHE VERSION >\bin\php.ini to \bin\php\<PHP VERSION>\
Set php PATH to <WAMP INSTALATION>\bin\php\<PHP VERSION>\
That should solve the problem.
It has since been changed,
"As part of our restructuring and working towards a better more robust framework in terms of features as well as organization, we have removed the IDE stubs from the Phalcon DevTools repository and moved to its own repository."
The new instructions are located here:
https://blog.phalconphp.com/post/phalcon-ide-stubs-repository

Is it possible to browse the source of OpenJDK online?

Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.
(Note: I don't want to download the source. I just want to browse it online, to see how some methods are implemented.)
OpenJDK is now on GitHub: https://github.com/openjdk/jdk
It is a large project, but you will find the implementations of the core classes under jdk/src/java.base/share/classes.
For instance you can find the implementation of java.util.List here.
If you need to browse older versions, you still need to use the old Mercurial interface.
The Mercurial interface there is quite confusing if you are not used to it, and since this is a large project, it can be hard to find what you are looking for.
Here is an example:
To find the JDK6 implementation java.util.List, select jdk6, jdk, select browse. Then browse to src/share/classes/java/util/List.java.
You should end up at http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/tip/src/share/classes/java/util/List.java
The latest JDK 8 OpenJDK Java Class Library source code can be found here: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/
Here is the basic step to get latest or any released version of Openjdk 8 (or any existing java version) source code, and use them in Eclipse.
Steps:
[browse source]
Open url for jdk, e.g http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/
click tags
choose proper tag, e.g jdk8u73-b02
then click browse,
then browse into folder src/share/classes,
[download source]
then click one of bz2 / zip / gz, to download source in relevant compressed format, (e.g for jdk8u73-b02 in zip format, the url will be: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/archive/2ab13901d6f1.zip/src/share/classes/)
[use in eclipse]
uncompress it,
zip the folder "classes/", make "classes/" as the root dir of .zip file, (e.g first cd jdk-2ab13901d6f1/src/share/, then zip -r openjdk_8u73_b2_src.zip classes/)
move the created zip file to proper location, it will stay there for a while, (e.g mv openjdk_8u73_b2_src.zip /media/Eric/software/java/jdk/openjdk/openjdk8u73-b02/source/)
in eclipse, specify source file for jars of installed jre, could specify the source attachment for each jar of installed jre respectively, the most common jar is probably rt.jar,
optionally, might need refresh project to make it totally take effect, not sure is that necessary,
test it: in eclipse, ctrl + shift + t, then input Cancellable, select the sun.nio.fs.Cancellable of corresponding installed jre,
if the source code is available, then it's good, because this source is not available in jdk_home/src.zip, it must be from the additional openjdk source,
switch source back: could switch back to use "jdk_home/src.zip", if don't want to use the external openjdk source,
ok
Here's a way to browse the repositories and look at just the bits you want.
http://hg.openjdk.java.net/
Is that what you are asking?
Append a "/file" to the root URLs to view the browser like this:
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/
http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file
Grepcode.com is great for similar things - not only OpenJDK sources, with searching in classes/methods and links between classes directly in highlighted code:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/net/Socket.java
As mentioned in the other answers, the source code repository is at https://hg.openjdk.java.net
However, the OpenJDK team mirrors some of the projects on GitHub: https://github.com/openjdk
Including the latest Java version project (https://hg.openjdk.java.net/jdk/jdk): https://github.com/openjdk/jdk
Surely http://hg.openjdk.java.net is one good option. The other equally good source is zGrepCode https://zgrepcode.com/java/openjdk/ . It has both Open JDK and Oracle java versions.