Full Code of welefen/Fiddler for AI

master 9a604cf0a4de cached
85 files
18.3 MB
236.8k tokens
332 symbols
1 requests
Download .txt
Showing preview only (971K chars total). Download the full file or copy to clipboard to get everything.
Repository: welefen/Fiddler
Branch: master
Commit: 9a604cf0a4de
Files: 85
Total size: 18.3 MB

Directory structure:
gitextract_fd4ce_x1/

├── .gitignore
├── Fiddler.pem
├── README.md
├── build.sh
├── clean.php
├── config.php
├── plugin/
│   ├── Info.plist
│   ├── README.md
│   ├── build_mac.sh
│   ├── chrome_fiddler.mm
│   ├── chrome_fiddler.plugin/
│   │   └── Contents/
│   │       ├── Info.plist
│   │       └── MacOS/
│   │           └── chrome_fiddler
│   ├── chrome_fiddler_plugin.cc
│   ├── chrome_fiddler_plugin.h
│   ├── chrome_fiddler_script_object.cc
│   ├── chrome_fiddler_script_object.h
│   ├── chrome_fiddler_vs2008_project/
│   │   ├── Debug/
│   │   │   ├── chrome_fiddler.exp
│   │   │   ├── chrome_fiddler.ilk
│   │   │   ├── chrome_fiddler.lib
│   │   │   └── chrome_fiddler.pdb
│   │   ├── Release/
│   │   │   ├── chrome_fiddler.exp
│   │   │   ├── chrome_fiddler.lib
│   │   │   └── chrome_fiddler.pdb
│   │   ├── chrome_fiddler/
│   │   │   ├── chrome_fiddler.aps
│   │   │   ├── chrome_fiddler.def
│   │   │   ├── chrome_fiddler.rc
│   │   │   ├── chrome_fiddler.vcproj
│   │   │   └── resource.h
│   │   ├── chrome_fiddler.ncb
│   │   ├── chrome_fiddler.sln
│   │   └── chrome_fiddler.suo
│   ├── log.cc
│   ├── log.h
│   ├── np_entry.cc
│   ├── npapi.h
│   ├── npfunctions.h
│   ├── npn_entry.cc
│   ├── npp_entry.cc
│   ├── npruntime.h
│   ├── nptypes.h
│   ├── plugin_base.cc
│   ├── plugin_base.h
│   ├── plugin_factory.cc
│   ├── plugin_factory.h
│   ├── script_object_base.cc
│   ├── script_object_base.h
│   ├── script_object_factory.cc
│   ├── script_object_factory.h
│   └── utils.h
├── src/
│   ├── bin/
│   │   └── chrome_fiddler.plugin/
│   │       └── Contents/
│   │           ├── Info.plist
│   │           └── MacOS/
│   │               └── chrome_fiddler
│   ├── css/
│   │   ├── lib/
│   │   │   ├── bootstrap.css
│   │   │   ├── fiddler.css
│   │   │   └── shCoreDefault.css
│   │   ├── lib.css
│   │   └── page/
│   │       └── options.css
│   ├── html/
│   │   ├── background.html
│   │   ├── devtools.html
│   │   └── options.html
│   ├── img/
│   │   └── icon.psd
│   ├── js/
│   │   ├── component/
│   │   │   ├── config.js
│   │   │   ├── event.js
│   │   │   ├── file.js
│   │   │   ├── resource.js
│   │   │   └── rule.js
│   │   ├── component.js
│   │   ├── lib/
│   │   │   ├── MimeTea.js
│   │   │   ├── SyntaxHighlighter/
│   │   │   │   ├── shBrushCss.js
│   │   │   │   ├── shBrushJScript.js
│   │   │   │   └── shCore.js
│   │   │   ├── base64.js
│   │   │   ├── beautify/
│   │   │   │   ├── beautify_css.js
│   │   │   │   ├── beautify_html.js
│   │   │   │   └── beautify_js.js
│   │   │   ├── bootstrap.js
│   │   │   ├── fiddler.js
│   │   │   ├── jquery.js
│   │   │   └── when.js
│   │   ├── lib.js
│   │   └── page/
│   │       ├── background.js
│   │       ├── devtools.js
│   │       └── options.js
│   └── manifest.json
└── test/
    ├── css/
    │   └── base.css
    └── index.html

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
output/


================================================
FILE: Fiddler.pem
================================================
-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKyyd3FMz631KwQ6A
oKT4lmDkKHvDf0H9NkgP0lcHz1sc9H1KFv8IopWd31Yex/ydKgq4rCklB0Pldy0Dr
3DRH7IHQqERLeMFP19pT8fhgJokRPu0CdxwZKQ/Mh83y4J1aW6kAvxvXBXIZZZn78
qDlGFgR94hGlV0P55ZThas/Z9AgMBAAECgYBrclI8LOUdv2b3Jzx+j5IJzYCEL97N
KlEdciHN+8H4Dmz1GYn1ySaYWXnYg99/HfOU2bHW416/wf2kpmZxjHclQBQdEe36/
s8gvapWrDso+tkvTNUWd9YVqD9a21YC1oZVzCPn8+RKh4+/ZZlzt/2Hn9qsutkgVH
coj+bItN5f5QJBAODPrawzdt7R6noaSRmXH9rTX5PcaEkTBgE7ngkgJKKDyPfoAel
HwVoB3lpw7/5GPRzpqHzmrsWcqwlb8eWILH8CQQDEp+u2yrJqte1VGr1TdzMHk+oy
x+DBP6uReYkQCMGQMnMfwPUYkyBbpJAQdJ9iODnk64p2GfuL/q1cty6QgA8DAkEA0
LS8/QMCNjYXQqgoeRNtxU86iiCyyDRa/MYGH16x5BYIeu3u6E1vWUomzTvP8fXvQm
pBu0LFujuKJbQwS/ExrQJAMJ02Rvy6uGh64CP5E44O/luRdLY2mG8t8Yty15TijMv
766ierlGImT8IIhlCYVx262FS3Dk2FviBUL8z8qLFkwJBALp7QMOcGzeEG3pmvCie
tqvEs4Nkw8p8itKF2Bs/5t5+Juy6aZobMFyN+JNtLbtplFBnShGKc+qjWH/F3pWTE
2s=
-----END PRIVATE KEY-----


================================================
FILE: README.md
================================================
[WARNING] 该项目停止维护,愿意维护的同学请联系 welefen@gmail.com,可以把项目转给你。

Fiddler
=======

Fiddler for Chrome Extension

visit http://welefen.github.io/Fiddler/ for more infomation.


================================================
FILE: build.sh
================================================
#!/bin/sh
STC_PATH="/Users/welefen/Develop/git/stc/src"
path=`dirname $0`;
first=${path:0:1};
if [[ $first != '/' ]];then
    path=$(pwd);
fi

if [ -d ${path}"/output" ];then
	rm -rf ${path}"/output";
fi
mkdir ${path}"/output";
if [ ! -f ${path}"/config.php" ];then
	cp $STC_PATH/config/config.php ${path};
fi
#path=$(pwd);
/usr/local/bin/php $STC_PATH/index.php ${path} test online;
if [ -f ${path}"/stc.error.log" ]; then
    rm -rf ${path}"/stc.error.log";
    #exit 1;
fi
cp src/manifest.json output/src/
cp -r src/bin output/src/;
mv output/src/ output/Fiddler;
if [[ $1 == "1" ]];then
    /usr/local/bin/php clean.php;
    cd output;
    zip -r Fiddler.zip Fiddler/;
fi


================================================
FILE: clean.php
================================================
<?php
$file = "output/Fiddler/manifest.json";
$content = file_get_contents($file);
$data = json_decode($content, true);
unset($data["plugins"]);
unset($data["update_url"]);
$content = json_encode($data);
file_put_contents($file, $content);


================================================
FILE: config.php
================================================
<?php
return array (
	'TPL_ENGINE' => 'smarty',  //模版引擎,支持Smarty和PHP
	'TPL_LEFT_DELIMITER' => '{%',  //smarty左界符
	'TPL_RIGHT_DELIMITER' => '%}',  //smarty右界符
	'TPL_SUFFIX' => 'tpl',  //模板文件后缀名
	'TPL_PATH' => 'src/application/views/tpls/',  //模板目录
	'STATIC_PATH' => 'src/',  //静态资源的目录
	'FILE_ENCODING' => 'utf-8',  //项目编码
	'MOD_DIRS_CHECK' => true,  //目录结构检测
	'MOD_FILE_CHECK' => true,  //文件命名和位置检测
	'MOD_HTML_REGULAR_CHECK' => true,  //HTML规范检测
	'MOD_CSS_REGULAR_CHECK' => true,  //CSS规范检测
	"MOD_EMPTY_CHECK" => true,  //空文件检测
	'MOD_CSS_SPRITES' => false,  //是否进行css sprites
	'MOD_CSS_AUTOCOMPLETE' => false,  //css样式自动补全
	'MOD_JS_COMBINE' => true,  //JS文件是否启用合并
	'MOD_CSS_COMBINE' => true,  //CSS文件是否启用合并
	'MOD_HTML_COMPRESS' => true,  //HTML文件是否启用压缩
	'MOD_JS_COMPRESS' => true,  //JS文件是否启用压缩
	'MOD_CSS_COMPRESS' => true,  //CSS文件是否启用压缩
	'MOD_OPTI_IMG' => false,  //是否优化图片
	'MOD_XSS_AUTO_FIXED' => false,  //是否进行XSS自动修复
	'MOD_IMG_DATAURI' => true,  //将CSS中的图片地址转换为dataURI
	'MOD_STATIC_TO_CDN' => false,  //是否将静态资源上线到CDN
	'MOD_JS_TPL_REPLACE' => false,  //是否进行前端模版替换
	'MOD_STRING_REPLACE' => true,  //是否进行代码替换功能
	'MOD_STATIC_VERSION' => 1,  //静态文件版本号,1或者true为query,2为新文件模式
	'COMPRESS_JS_USE_JINGCHUANG' => false,
    'HTML_COMPRESS_OPTIONS' => array('compress_tpl_script'=> true)
);




================================================
FILE: plugin/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>chrome_fiddler</string>
	<key>CFBundleGetInfoString</key>
	<string>420+, Copyright 2006-2009 Apple Inc.</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>chrome.chrome_fiddler</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>BRPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>CFPlugInDynamicRegisterFunction</key>
	<string></string>
	<key>CFPlugInDynamicRegistration</key>
	<string>NO</string>
	<key>CFPlugInFactories</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<string>MyFactoryFunction</string>
	</dict>
	<key>CFPlugInTypes</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<array>
			<string>00000000-0000-0000-0000-000000000000</string>
		</array>
	</dict>
	<key>CFPlugInUnloadFunction</key>
	<string></string>
	<key>WebPluginDescription</key>
	<string>Chrome Fiddler Extension Plugin</string>
	<key>WebPluginMIMETypes</key>
	<dict>
		<key>application/x-chromefiddler</key>
		<dict>
			<key>WebPluginExtensions</key>
			<array>
				<string>chrome_fiddler</string>
			</array>
			<key>WebPluginTypeDescription</key>
			<string>Chrome Fiddler Extension Plugin</string>
		</dict>
	</dict>
	<key>WebPluginName</key>
	<string>Chrome Fiddler Extension Plugin</string>
</dict>
</plist>


================================================
FILE: plugin/README.md
================================================
* prototype from [chrome-screen-capture](http://chrome-screen-capture.googlecode.com/svn/trunk/src/plugin)

## Summary

现阶段主要功能是,弹出系统文件选择框,用户通过选择、确定后,将所选文件或文件夹路径返回

## Methods

    var path = plugin.GetFilePath(initial_path, dialog_title);

弹出文件选择框,返回所选文件路径

* `initial_path` 是文件选择框的初始位置
* `dialog_title` 是文件选择框上方的标题
* `path` 是用户所选文件的路径

- - -

    var path = plugin.GetFolderPath(initial_path, dialog_title);

弹出文件夹选择框,返回所选文件夹路径

* `initial_path` 是文件夹选择框的初始位置
* `dialog_title` 是文件夹选择框上方的标题
* `path` 是用户所选文件夹的路径

- - -

    var path = plugin.OpenFileDialog(initial_path, option)

**Deprecated.** 此方法是上面两个方法的结合,缺点在于不能对文件选择框的标题进行设置。
由于前期方法名字起的不好,没准哪天心情不好就去除了,所以标记不建议使用了。

* `initial_path` 是文件或文件夹选择框的初始位置
* `option` 是 `"file"` 则打开文件选择框,是 `"path"` 则打开文件夹选择框
* `path` 是用户所选文件或文件夹的路径

## Example

Mac OSX 下的文件 [chrome_fiddler.plugin][1],Windows 下的文件 [chrome_fiddler.dll][2],type 为 `application/x-chromefiddler`

[1]: https://github.com/welefen/Fiddler/tree/master/plugin/chrome_fiddler.plugin
[2]: https://github.com/welefen/Fiddler/blob/master/plugin/chrome_fiddler_vs2008_project/Release/chrome_fiddler.dll

    <!doctype html>
    <html>
        <head>
            <script>
                window.onload = function(e) {
                    var plugin = document.getElementById("chromefiddler");
                };
            </script>
        </head>
        <body>
            <embed id="chromefiddler" type="application/x-chromefiddler">
        </body>
    </html>



================================================
FILE: plugin/build_mac.sh
================================================
#!/bin/sh
mkdir -p chrome_fiddler.plugin/Contents/MacOS
cp -f Info.plist chrome_fiddler.plugin/Contents
g++ -framework Cocoa -DMAC -Wall \
    -DWEBKIT_DARWIN_SDK -lresolv -arch i386 -bundle \
    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ \
    -mmacosx-version-min=10.6 \
    -o chrome_fiddler.plugin/Contents/MacOS/chrome_fiddler \
    log.cc np_entry.cc npn_entry.cc npp_entry.cc plugin_base.cc \
    plugin_factory.cc chrome_fiddler.mm chrome_fiddler_plugin.cc \
    chrome_fiddler_script_object.cc script_object_base.cc script_object_factory.cc &&\
cp chrome_fiddler.plugin/Contents/MacOS/chrome_fiddler \
    ../src/bin/chrome_fiddler.plugin/Contents/MacOS/


================================================
FILE: plugin/chrome_fiddler.mm
================================================
#include <string>
#import <Cocoa/Cocoa.h>


std::string GetFilePathNS(const char* path, const char* dialog_title, bool isFolder) {
    int runResult;
    NSString *str = [NSString stringWithUTF8String:path];
    str = [NSString stringWithFormat:@"%@%@", @"file://", str];
    NSURL *url = [NSURL URLWithString:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

    NSOpenPanel *op = [NSOpenPanel openPanel];

    if (isFolder) {
        [op setCanChooseDirectories:YES];
        [op setCanChooseFiles:NO];
    } else {
        [op setCanChooseDirectories:NO];
        [op setCanChooseFiles:YES];
    }
    [op setAllowsMultipleSelection:NO];
    [op setDirectoryURL:url];
    [op setTitle:[NSString stringWithUTF8String:dialog_title]];

    runResult = [op runModal];

    if (runResult == NSOKButton) {
        NSArray *paths = [op URLs];
        return [[[paths lastObject] path] UTF8String];
    } else {
        return [[NSString stringWithUTF8String:path] UTF8String];
    }
}

bool IsWritableFile(const char* path) {
    NSFileManager *fm = [NSFileManager defaultManager];
    return [fm isWritableFileAtPath:[NSString stringWithUTF8String:path]];
}



================================================
FILE: plugin/chrome_fiddler.plugin/Contents/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>chrome_fiddler</string>
	<key>CFBundleGetInfoString</key>
	<string>420+, Copyright 2006-2009 Apple Inc.</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>chrome.chrome_fiddler</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>BRPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>CFPlugInDynamicRegisterFunction</key>
	<string></string>
	<key>CFPlugInDynamicRegistration</key>
	<string>NO</string>
	<key>CFPlugInFactories</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<string>MyFactoryFunction</string>
	</dict>
	<key>CFPlugInTypes</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<array>
			<string>00000000-0000-0000-0000-000000000000</string>
		</array>
	</dict>
	<key>CFPlugInUnloadFunction</key>
	<string></string>
	<key>WebPluginDescription</key>
	<string>Chrome Fiddler Extension Plugin</string>
	<key>WebPluginMIMETypes</key>
	<dict>
		<key>application/x-chromefiddler</key>
		<dict>
			<key>WebPluginExtensions</key>
			<array>
				<string>chrome_fiddler</string>
			</array>
			<key>WebPluginTypeDescription</key>
			<string>Chrome Fiddler Extension Plugin</string>
		</dict>
	</dict>
	<key>WebPluginName</key>
	<string>Chrome Fiddler Extension Plugin</string>
</dict>
</plist>


================================================
FILE: plugin/chrome_fiddler_plugin.cc
================================================
#include "chrome_fiddler_plugin.h"

#include <string.h>

#include "log.h"
#include "chrome_fiddler_script_object.h"
#include "script_object_factory.h"


extern Log g_logger;

NPError ChromeFiddlerPlugin::Init(NPP instance, uint16_t mode, int16_t argc, char* argn[],char* argv[], NPSavedData* saved) {
    g_logger.WriteLog("msg", "ChromeFiddlerPlugin Init");
    script_object_ = NULL;

#ifdef _WINDOWS
    int bWindowed = 1;
#else
    int bWindowed = 0;
#endif

#ifdef MAC
    // Select the right drawing model if necessary.
    NPBool support_core_graphics = false;
    if (NPN_GetValue(instance, NPNVsupportsCoreGraphicsBool, &support_core_graphics) == NPERR_NO_ERROR && support_core_graphics)
        NPN_SetValue(instance, NPPVpluginDrawingModel, (void*)NPDrawingModelCoreGraphics);
    else
        return NPERR_INCOMPATIBLE_VERSION_ERROR;

    // Select the Cocoa event model.
    NPBool support_cocoa_events = false;
    if (NPN_GetValue(instance, NPNVsupportsCocoaBool, &support_cocoa_events) == NPERR_NO_ERROR && support_cocoa_events)
        NPN_SetValue(instance, NPPVpluginEventModel, (void*)NPEventModelCocoa);
    else
        return NPERR_INCOMPATIBLE_VERSION_ERROR;
#endif

    NPN_SetValue(instance, NPPVpluginWindowBool, (void *)bWindowed);
    instance->pdata = this;
    return PluginBase::Init(instance, mode, argc, argn, argv, saved);
}

NPError ChromeFiddlerPlugin::UnInit(NPSavedData** save) {
    g_logger.WriteLog("msg", "ChromeFiddlerPlugin UnInit");
    g_logger.CloseLog();
    PluginBase::UnInit(save);
    script_object_ = NULL;
    return NPERR_NO_ERROR;
}

NPError ChromeFiddlerPlugin::GetValue(NPPVariable variable, void *value) {
    switch(variable) {
        case NPPVpluginScriptableNPObject:
            if (script_object_ == NULL)
                script_object_ = ScriptObjectFactory::CreateObject(get_npp(), ChromeFiddlerScriptObject::Allocate);
            if (script_object_ != NULL)
                *(NPObject**)value = script_object_;
            else
                return NPERR_OUT_OF_MEMORY_ERROR;
            break;
        case NPPVpluginNeedsXEmbed:
            *(bool*)value = 1;
            break;
        default:
            return NPERR_GENERIC_ERROR;
    }
    return NPERR_NO_ERROR;
}

NPError ChromeFiddlerPlugin::SetWindow(NPWindow* window) {
#ifdef _WINDOWS
    PluginBase::SetWindow(window);
#endif

    return NPERR_NO_ERROR;
}



================================================
FILE: plugin/chrome_fiddler_plugin.h
================================================
#ifndef CHROME_FIDDLER_PLUGIN_H_
#define CHROME_FIDDLER_PLUGIN_H_

#include "npapi.h"
#include "npruntime.h"
#include "npfunctions.h"
#include "plugin_base.h"
#include "script_object_base.h"

class ChromeFiddlerPlugin : public PluginBase {
public:
    ChromeFiddlerPlugin() {}
    virtual ~ChromeFiddlerPlugin() {}

    NPError Init(NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
    NPError UnInit(NPSavedData** saved);
    NPError GetValue(NPPVariable variable, void *value);
    NPError SetWindow(NPWindow* window);

    static PluginBase* CreateObject() { return new ChromeFiddlerPlugin; }

private:
    ScriptObjectBase* script_object_;
};

#endif // CHROME_FIDDLER_PLUGIN_H_


================================================
FILE: plugin/chrome_fiddler_script_object.cc
================================================
#include "chrome_fiddler_script_object.h"

#include <stdlib.h>
#include <string.h>

#ifdef _WINDOWS
#include <atlenc.h>
#include <GdiPlus.h>
#include <io.h>
#include <ShlObj.h>
#elif defined __APPLE__
#include <libgen.h>
#include <resolv.h>
#endif

#include <string>

#include "log.h"
#include "chrome_fiddler_plugin.h"
#include "utils.h"

#ifdef _WINDOWS
using namespace Gdiplus;
#define snprintf sprintf_s
struct BrowserParam {
    TCHAR initial_path[MAX_PATH];
    TCHAR title[MAX_PATH];
};
#else
#define MAX_PATH 260
#endif

extern Log g_logger;

NPObject* ChromeFiddlerScriptObject::Allocate(NPP npp, NPClass *aClass) {
    g_logger.WriteLog("msg", "ChromeFiddlerScriptObject Allocate");
    ChromeFiddlerScriptObject* script_object = new ChromeFiddlerScriptObject;
    if (script_object != NULL)
        script_object->set_plugin((PluginBase*)npp->pdata);
    return script_object;
}

void ChromeFiddlerScriptObject::Deallocate() {
    g_logger.WriteLog("msg", "ChromeFiddlerScriptObject Deallocate");
    delete this;
}

void ChromeFiddlerScriptObject::InitHandler() {
    FunctionItem item;
    item.function_name = "OpenFileDialog";
    item.function_pointer = ON_INVOKEHELPER(&ChromeFiddlerScriptObject::OpenFileDialog);
    AddFunction(item);
    item.function_name = "GetFilePath";
    item.function_pointer = ON_INVOKEHELPER(&ChromeFiddlerScriptObject::GetFilePath);
    AddFunction(item);
    item.function_name = "GetFolderPath";
    item.function_pointer = ON_INVOKEHELPER(&ChromeFiddlerScriptObject::GetFolderPath);
    AddFunction(item);
    item.function_name = "SaveFile";
    item.function_pointer = ON_INVOKEHELPER(&ChromeFiddlerScriptObject::SaveFile);
    AddFunction(item);
}

#ifdef _WINDOWS
namespace {

int WINAPI BrowserCallback(NativeWindow nw, UINT uMsg, LPARAM lParam, LPARAM lpData) {
    switch (uMsg) {
    case BFFM_INITIALIZED:
        BrowserParam* param = (BrowserParam*)lpData;
        SendMessage(nw, BFFM_SETSELECTION, TRUE, (LPARAM)param->initial_path);
        SetWindowText(nw, param->title);
        NativeWindow treeview = FindWindowEx(nw, NULL, L"SysTreeView32", NULL);
        NativeWindow ok_button = FindWindowEx(nw, NULL, L"Button", NULL);

        if (treeview && ok_button) {
            RECT rect_treeview,rect_ok_button;

            GetWindowRect(treeview, &rect_treeview);
            POINT pt_treeview, pt_button;
            pt_treeview.x = rect_treeview.left;
            pt_treeview.y = 0;
            ScreenToClient(nw, &pt_treeview);

            GetWindowRect(ok_button, &rect_ok_button);
            pt_button.x = rect_ok_button.left;
            pt_button.y = rect_ok_button.top;
            ScreenToClient(nw, &pt_button);
            MoveWindow(treeview, pt_treeview.x, pt_treeview.x, rect_treeview.right-rect_treeview.left, pt_button.y-2*pt_treeview.x, TRUE);
        }
        break;
    }
    return 0;
}

}
#elif defined __APPLE__
std::string GetFilePathNS(const char* path, const char* dialog_title, bool isFolder);
bool IsWritableFile(const char* path);
#endif

bool ChromeFiddlerScriptObject::OpenFileDialog(const NPVariant* args, uint32_t argCount, NPVariant* result) {
    if (argCount < 2 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]))
        return false;

    std::string option(NPVARIANT_TO_STRING(args[1]).UTF8Characters, NPVARIANT_TO_STRING(args[1]).UTF8Length);
    std::string title = "Select A Stuff, Buddy";
    size_t length = title.length();

    NPVariant dialog_title;
    STRINGN_TO_NPVARIANT(title.c_str(), length, dialog_title);
    const NPVariant params[2] = {args[0], dialog_title};

    if (option == "file")
        return GetFilePath(params, 2, result);
    else
        return GetFolderPath(params, 2, result);
}

bool ChromeFiddlerScriptObject::GetFilePath(const NPVariant* args, uint32_t argCount, NPVariant* result) {
    if (argCount < 2 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]))
        return false;

    std::string path(NPVARIANT_TO_STRING(args[0]).UTF8Characters, NPVARIANT_TO_STRING(args[0]).UTF8Length);
    std::string title(NPVARIANT_TO_STRING(args[1]).UTF8Characters, NPVARIANT_TO_STRING(args[1]).UTF8Length);

#ifdef _WINDOWS
    TCHAR display_name[MAX_PATH] = {0};
    BrowserParam param = {0};
    BOOL bRet;

    MultiByteToWideChar(CP_UTF8, 0, path.c_str(), -1, param.initial_path, MAX_PATH);
    MultiByteToWideChar(CP_UTF8, 0, title.c_str(), -1, param.title, MAX_PATH);

    OPENFILENAME ofn = {0};
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = get_plugin()->get_native_window();
    ofn.lpstrFilter = _T("All Files(*.*)\0*.*\0");
    ofn.lpstrInitialDir = param.initial_path;
    ofn.lpstrFile = display_name;
    ofn.nMaxFile = sizeof(display_name) / sizeof(*display_name);
    ofn.nFilterIndex = 0;
    ofn.lpstrTitle = param.title;
    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXPLORER;

    bRet = GetOpenFileName(&ofn);

    char utf8[MAX_PATH];
    WideCharToMultiByte(CP_UTF8, 0, bRet ? display_name : param.initial_path, -1, utf8, MAX_PATH, 0, 0);
    size_t length = strlen(utf8);

#elif __APPLE__
    std::string pathStr = GetFilePathNS(path.c_str(), title.c_str(), false);
    const char* utf8 = pathStr.c_str();
    size_t length = pathStr.length();

#endif

    char* copy = (char *)NPN_MemAlloc(length + 1);
    memcpy(copy, utf8, length);
    copy[length] = 0;
    STRINGN_TO_NPVARIANT(copy, length, *result);

    return true;
}

bool ChromeFiddlerScriptObject::GetFolderPath(const NPVariant* args, uint32_t argCount, NPVariant* result) {
    if (argCount < 2 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]))
        return false;

    std::string path(NPVARIANT_TO_STRING(args[0]).UTF8Characters, NPVARIANT_TO_STRING(args[0]).UTF8Length);
    std::string title(NPVARIANT_TO_STRING(args[1]).UTF8Characters, NPVARIANT_TO_STRING(args[1]).UTF8Length);

#ifdef _WINDOWS
    TCHAR display_name[MAX_PATH] = {0};
    BrowserParam param = {0};
    BOOL bRet;

    MultiByteToWideChar(CP_UTF8, 0, path.c_str(), -1, param.initial_path, MAX_PATH);
    MultiByteToWideChar(CP_UTF8, 0, title.c_str(), -1, param.title, MAX_PATH);

    BROWSEINFO info = {0};
    info.hwndOwner = get_plugin()->get_native_window();
    info.lpszTitle = NULL;
    info.pszDisplayName = display_name;
    info.lpfn = BrowserCallback;
    info.ulFlags = BIF_RETURNONLYFSDIRS;
    info.lParam = (LPARAM)&param;

    bRet = SHGetPathFromIDList(SHBrowseForFolder(&info), display_name);

    char utf8[MAX_PATH];
    WideCharToMultiByte(CP_UTF8, 0, bRet ? display_name : param.initial_path, -1, utf8, MAX_PATH, 0, 0);
    size_t length = strlen(utf8);

#elif __APPLE__
    std::string pathStr = GetFilePathNS(path.c_str(), title.c_str(), true);
    const char* utf8 = pathStr.c_str();
    size_t length = pathStr.length();

#endif

    char* copy = (char *)NPN_MemAlloc(length + 1);
    memcpy(copy, utf8, length);
    copy[length] = 0;
    STRINGN_TO_NPVARIANT(copy, length, *result);

    return true;
}

bool ChromeFiddlerScriptObject::SaveFile(const NPVariant* args, uint32_t argCount, NPVariant* result) {
    if (argCount < 3 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]) || !NPVARIANT_IS_OBJECT(args[2]) || !NPVARIANT_TO_OBJECT(args[2]))
        return false;

    const char* fileName = NPVARIANT_TO_STRING(args[0]).UTF8Characters;
    const char* content = NPVARIANT_TO_STRING(args[1]).UTF8Characters;
    uint32_t length = NPVARIANT_TO_STRING(args[1]).UTF8Length;
    NPObject* callback = NPVARIANT_TO_OBJECT(args[2]);

#ifdef _WINDOWS
    TCHAR szWideBuf[MAX_PATH] = { 0 };
    MultiByteToWideChar(CP_UTF8, 0, fileName, -1, szWideBuf, MAX_PATH);
    DWORD d = GetFileAttributes(szWideBuf);
    if (!PathFileExists(szWideBuf) || d & FILE_ATTRIBUTE_DIRECTORY || d & FILE_ATTRIBUTE_READONLY) {
        g_logger.WriteLog("error", "SaveFile: Is A Folder");

#elif defined __APPLE__
    if (!IsWritableFile(fileName)) {
        g_logger.WriteLog("error", "SaveFile: File Is Not Writable");

#endif
        InvokeCallback(get_plugin()->get_npp(), callback, "failure");
        return true;
    }

#ifdef _WINDOWS
    int len = MultiByteToWideChar(CP_UTF8, 0, fileName, -1, NULL, 0);
    wchar_t* wstr = new wchar_t[len + 1];
    memset(wstr, 0, len * 2 + 2);
    MultiByteToWideChar(CP_UTF8, 0, fileName, -1, wstr, len);

    len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL);
    char* path = new char[len + 1];
    memset(path, 0, len + 1);
    WideCharToMultiByte (CP_ACP, 0, wstr, -1, path, len, NULL, NULL);

    delete[] wstr;
    FILE* out = fopen(path, "w");

#elif defined __APPLE__
    FILE* out = fopen(fileName, "w");

#endif
    if (out) {
        fwrite(content, length, 1, out);
        fclose(out);
        InvokeCallback(get_plugin()->get_npp(), callback, "success");
        return true;
    }

    g_logger.WriteLog("error", "SaveFile: File Cannot Open");
    InvokeCallback(get_plugin()->get_npp(), callback, "failure");
    return true;
}

// static
void ChromeFiddlerScriptObject::InvokeCallback(NPP npp, NPObject* callback, const char* param) {
    NPVariant npParam;
    STRINGZ_TO_NPVARIANT(param, npParam);
    NPVariant result;
    VOID_TO_NPVARIANT(result);
    NPN_InvokeDefault(npp, callback, &npParam, 1, &result);
}



================================================
FILE: plugin/chrome_fiddler_script_object.h
================================================
#ifndef CHROME_FIDDLER_SCRIPT_OBJECT_H_
#define CHROME_FIDDLER_SCRIPT_OBJECT_H_

#include "npfunctions.h"
#include "script_object_base.h"

class ChromeFiddlerScriptObject: public ScriptObjectBase {
public:
    ChromeFiddlerScriptObject() {}
    virtual ~ChromeFiddlerScriptObject() {}

    static NPObject* Allocate(NPP npp, NPClass* aClass);

    void Deallocate();
    void Invalidate() {}
    bool Construct(const NPVariant* args, uint32_t argCount, NPVariant* result) { return true; }
    bool OpenFileDialog(const NPVariant* args, uint32_t argCount, NPVariant* result);
    bool GetFilePath(const NPVariant* args, uint32_t argCount, NPVariant* result);
    bool GetFolderPath(const NPVariant* args, uint32_t argCount, NPVariant* result);
    bool SaveFile(const NPVariant* args, uint32_t argCount, NPVariant* result);

    void InitHandler();

private:
    static void InvokeCallback(NPP npp, NPObject* callback, const char* param);

};

#endif    // CHROME_FIDDLER_SCRIPT_OBJECT_H_


================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.def
================================================
LIBRARY	"chrome_fiddler"

EXPORTS
	NP_GetEntryPoints     @1
	NP_Initialize         @2
	NP_Shutdown           @3
	NP_GetMIMEDescription @4

================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.rc
================================================
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winresrc.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// (л񹲺͹) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_PREVIEW DIALOGEX 0, 0, 366, 211
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO 
BEGIN
    IDD_PREVIEW, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 359
        TOPMARGIN, 7
        BOTTOMMARGIN, 204
    END
END
#endif    // APSTUDIO_INVOKED

#endif    // (л񹲺͹) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// Ӣ() resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x40004L
 FILETYPE 0x2L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904e4"
        BEGIN
			VALUE "FileDescription", "This is a npapi plugin built for Chrome on Windows."
            VALUE "FileOpenName", "Chrome Fiddler Plugin"
            VALUE "FileVersion", "1, 0, 0, 1"
            VALUE "InternalName", "ChromeFiddlerPlugin"
            VALUE "LegalCopyright", "Copyright 2013 Ice White"
            VALUE "MIMEType", "application/x-chromefiddler"
            VALUE "OriginalFilename", "chrome_fiddler.dll"
            VALUE "ProductName", "Chrome Fiddler Plugin"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1252
    END
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""winresrc.h""\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED

#endif    // Ӣ() resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED



================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.vcproj
================================================
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="chrome_fiddler"
	ProjectGUID="{DD996793-2B7D-464D-BA6A-0B9CB08557EE}"
	RootNamespace="chrome_fiddler"
	Keyword="Win32Proj"
	TargetFrameworkVersion="196613"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="DEBUG;WIN32;_WINDOWS;XP_WIN32;MOZILLA_STRICT_API;XPCOM_GLUE;XP_WIN;_X86_;NPSIMPLE_EXPORTS;XULRUNNER_SDK"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="3"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				DebugInformationFormat="4"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				LinkIncremental="2"
				ModuleDefinitionFile="chrome_fiddler.def"
				GenerateDebugInformation="true"
				SubSystem="2"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="1"
			WholeProgramOptimization="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				EnableIntrinsicFunctions="true"
				PreprocessorDefinitions="WIN32;_WINDOWS;XP_WIN32;MOZILLA_STRICT_API;XPCOM_GLUE;XP_WIN;_X86_;NPSIMPLE_EXPORTS"
				RuntimeLibrary="2"
				EnableFunctionLevelLinking="true"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				LinkIncremental="1"
				ModuleDefinitionFile="chrome_fiddler.def"
				GenerateDebugInformation="true"
				SubSystem="2"
				OptimizeReferences="2"
				EnableCOMDATFolding="2"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Դļ"
			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
			>
			<File
				RelativePath=".\chrome_fiddler.def"
				>
			</File>
			<File
				RelativePath="..\..\chrome_fiddler_plugin.cc"
				>
			</File>
			<File
				RelativePath="..\..\chrome_fiddler_script_object.cc"
				>
			</File>
			<File
				RelativePath="..\..\log.cc"
				>
			</File>
			<File
				RelativePath="..\..\np_entry.cc"
				>
			</File>
			<File
				RelativePath="..\..\npn_entry.cc"
				>
			</File>
			<File
				RelativePath="..\..\npp_entry.cc"
				>
			</File>
			<File
				RelativePath="..\..\plugin_base.cc"
				>
			</File>
			<File
				RelativePath="..\..\plugin_factory.cc"
				>
			</File>
			<File
				RelativePath="..\..\script_object_base.cc"
				>
			</File>
			<File
				RelativePath="..\..\script_object_factory.cc"
				>
			</File>
		</Filter>
		<Filter
			Name="ͷļ"
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
			>
			<File
				RelativePath="..\..\chrome_fiddler_plugin.h"
				>
			</File>
			<File
				RelativePath="..\..\chrome_fiddler_script_object.h"
				>
			</File>
			<File
				RelativePath="..\..\log.h"
				>
			</File>
			<File
				RelativePath="..\..\npapi.h"
				>
			</File>
			<File
				RelativePath="..\..\npfunctions.h"
				>
			</File>
			<File
				RelativePath="..\..\npruntime.h"
				>
			</File>
			<File
				RelativePath="..\..\nptypes.h"
				>
			</File>
			<File
				RelativePath="..\..\plugin_base.h"
				>
			</File>
			<File
				RelativePath="..\..\plugin_factory.h"
				>
			</File>
			<File
				RelativePath=".\resource.h"
				>
			</File>
			<File
				RelativePath="..\..\script_object_base.h"
				>
			</File>
			<File
				RelativePath="..\..\script_object_factory.h"
				>
			</File>
			<File
				RelativePath="..\..\utils.h"
				>
			</File>
		</Filter>
		<Filter
			Name="Դļ"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
			>
			<File
				RelativePath=".\chrome_fiddler.rc"
				>
			</File>
		</Filter>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>


================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler/resource.h
================================================
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by chrome_fiddler.rc

// ¶һĬֵ
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif


================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler.ncb
================================================
[File too large to display: 17.4 MB]

================================================
FILE: plugin/chrome_fiddler_vs2008_project/chrome_fiddler.sln
================================================

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chrome_fiddler", "chrome_fiddler\chrome_fiddler.vcproj", "{DD996793-2B7D-464D-BA6A-0B9CB08557EE}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{DD996793-2B7D-464D-BA6A-0B9CB08557EE}.Debug|Win32.ActiveCfg = Debug|Win32
		{DD996793-2B7D-464D-BA6A-0B9CB08557EE}.Debug|Win32.Build.0 = Debug|Win32
		{DD996793-2B7D-464D-BA6A-0B9CB08557EE}.Release|Win32.ActiveCfg = Release|Win32
		{DD996793-2B7D-464D-BA6A-0B9CB08557EE}.Release|Win32.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


================================================
FILE: plugin/log.cc
================================================
#include "log.h"

#include <stdlib.h>

#ifndef _WINDOWS
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#endif

#ifndef _WINDOWS
#define MAX_PATH 260
#endif

Log::Log(void) {
    file_ = NULL;
}

Log::~Log(void) {
    if (file_ != NULL)
        CloseLog();
}

bool Log::OpenLog(const char* header) {
    if (file_ != NULL)
        return false;

#ifdef _WINDOWS
    char filename[MAX_PATH];
    GetLocalTime(&time_);
    sprintf_s(filename, "C:\\Windows\\Temp\\%s_%d%02d%02d_%d.log", header, time_.wYear, time_.wMonth, time_.wDay, GetCurrentProcessId());
#else
    char filename[MAX_PATH];
    time_t nowtime = time(NULL);
    struct tm* time_ = localtime(&nowtime);
    sprintf(filename, "/tmp/%s_%d%02d%02d_%d.log", header, time_->tm_year+1900, time_->tm_mon+1, time_->tm_mday, getpid());
#endif
    file_ = fopen(filename, "a");
    if (file_ == NULL)
        return false;
    else
        return true;
}

bool Log::WriteLog(const char* title, const char* contents) {
    if (file_ == NULL) {
        return false;
    }

#ifdef _WINDOWS
    GetLocalTime(&time_);
    if (fprintf(file_, "[%02d:%02d:%02d %03d] [%s] %s\n", time_.wHour, time_.wMinute, time_.wSecond, time_.wMilliseconds, title, contents) > 0) {
#else
    timeval nowtime;
    gettimeofday(&nowtime, NULL);
    struct tm* time_ = localtime(&nowtime.tv_sec);
    if (fprintf(file_, "[%02d:%02d:%02d %ld] [%s] %s\n", time_->tm_hour, time_->tm_min, time_->tm_sec, (unsigned long)nowtime.tv_usec, title, contents) > 0) {
#endif
        fflush(file_);
        return true;
    } else
        return false;
}

bool Log::CloseLog() {
    if (file_ != NULL) {
        fclose(file_);
        file_ = NULL;
    }
    return true;
}


================================================
FILE: plugin/log.h
================================================
#ifndef LOG_H_
#define LOG_H_

#include <stdio.h>

#ifdef _WINDOWS
#include <windows.h>
#endif

class Log {
public:
    Log(void);
    ~Log(void);

    bool OpenLog(const char* header);
    bool WriteLog(const char* title, const char* contents);
    bool CloseLog();

private:
    FILE* file_;
#ifdef _WINDOWS
    SYSTEMTIME time_;
#endif
};

#endif


================================================
FILE: plugin/np_entry.cc
================================================
#include <stdio.h>

#include "log.h"
#include "npapi.h"
#include "npfunctions.h"
#include "plugin_factory.h"

#ifdef _WINDOWS
#include <windows.h>
#include <GdiPlus.h>
using namespace Gdiplus;
ULONG_PTR token;
#pragma comment(lib,"gdiplus.lib")
#endif

extern NPNetscapeFuncs* g_npn_funcs;

Log g_logger;

#ifdef __cplusplus
extern "C" {
#endif

#ifndef HIBYTE
#define HIBYTE(x) ((((unsigned short)(x)) & 0xff00) >> 8)
#endif

NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* nppfuncs) {
    nppfuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
    nppfuncs->newp = NPP_New;
    nppfuncs->destroy = NPP_Destroy;
    nppfuncs->setwindow = NPP_SetWindow;
    nppfuncs->newstream = NPP_NewStream;
    nppfuncs->destroystream = NPP_DestroyStream;
    nppfuncs->asfile = NPP_StreamAsFile;
    nppfuncs->writeready = NPP_WriteReady;
    nppfuncs->write = NPP_Write;
    nppfuncs->print = NPP_Print;
    nppfuncs->event = NPP_HandleEvent;
    nppfuncs->urlnotify = NPP_URLNotify;
    nppfuncs->getvalue = NPP_GetValue;
    nppfuncs->setvalue = NPP_SetValue;
    return NPERR_NO_ERROR;
}

NPError OSCALL NP_Initialize(NPNetscapeFuncs* npnf
#if !defined(_WINDOWS) && !defined(WEBKIT_DARWIN_SDK)
                             , NPPluginFuncs* nppfuncs
#endif
                             ) {
    PluginFactory::Init();
    g_logger.OpenLog("NPAPI");
    if(npnf == NULL) {
        return NPERR_INVALID_FUNCTABLE_ERROR;
    }
    if(HIBYTE(npnf->version) > NP_VERSION_MAJOR) {
        return NPERR_INCOMPATIBLE_VERSION_ERROR;
    }
    g_npn_funcs = npnf;
#if !defined(_WINDOWS) && !defined(WEBKIT_DARWIN_SDK)
    NP_GetEntryPoints(nppfuncs);
#endif
#ifdef _WINDOWS
    GdiplusStartupInput input;
    GdiplusStartup(&token, &input, NULL);
#endif
    return NPERR_NO_ERROR;
}

NPError OSCALL NP_Shutdown() {
#ifdef _WINDOWS
    GdiplusShutdown(token);
#endif
    return NPERR_NO_ERROR;
}

char* NP_GetMIMEDescription(void) {
    return "application/x-chromefiddler::Fiddler in Chrome";
}

// Needs to be present for WebKit based browsers.
NPError OSCALL NP_GetValue(void* npp, NPPVariable variable, void* value) {
    return NPP_GetValue((NPP)npp, variable, value);
}
#ifdef __cplusplus
}
#endif


================================================
FILE: plugin/npapi.h
================================================
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef npapi_h_
#define npapi_h_

#if defined(__OS2__)
#pragma pack(1)
#endif

#include "nptypes.h"

#if defined(__OS2__) || defined(OS2)
#ifndef XP_OS2
#define XP_OS2 1
#endif
#endif

#if defined(_WIN32) && !defined(__SYMBIAN32__)
#include <windef.h>
#ifndef XP_WIN
#define XP_WIN 1
#endif
#endif

#if defined(__SYMBIAN32__)
#ifndef XP_SYMBIAN
#define XP_SYMBIAN 1
#undef XP_WIN
#endif
#endif

#if defined(__APPLE_CC__) && !defined(XP_UNIX)
#ifndef XP_MACOSX
#define XP_MACOSX 1
#endif
#endif

#if defined(XP_MACOSX) && defined(__LP64__)
#define NP_NO_QUICKDRAW
#define NP_NO_CARBON
#endif

#if defined(XP_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
#include <OpenGL/OpenGL.h>
#ifndef NP_NO_CARBON
#include <Carbon/Carbon.h>
#endif
#endif

#if defined(XP_UNIX)
#include <stdio.h>
#if defined(MOZ_X11)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#endif

#if defined(XP_SYMBIAN)
#include <QEvent>
#include <QRegion>
#endif

/*----------------------------------------------------------------------*/
/*                        Plugin Version Constants                      */
/*----------------------------------------------------------------------*/

#define NP_VERSION_MAJOR 0
#define NP_VERSION_MINOR 26


/* The OS/2 version of Netscape uses RC_DATA to define the
   mime types, file extensions, etc that are required.
   Use a vertical bar to separate types, end types with \0.
   FileVersion and ProductVersion are 32bit ints, all other
   entries are strings that MUST be terminated with a \0.

AN EXAMPLE:

RCDATA NP_INFO_ProductVersion { 1,0,0,1,}

RCDATA NP_INFO_MIMEType    { "video/x-video|",
                             "video/x-flick\0" }
RCDATA NP_INFO_FileExtents { "avi|",
                             "flc\0" }
RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
                             "MMOS2 Flc/Fli player(*.flc)\0" }

RCDATA NP_INFO_FileVersion       { 1,0,0,1 }
RCDATA NP_INFO_CompanyName       { "Netscape Communications\0" }
RCDATA NP_INFO_FileDescription   { "NPAVI32 Extension DLL\0"
RCDATA NP_INFO_InternalName      { "NPAVI32\0" )
RCDATA NP_INFO_LegalCopyright    { "Copyright Netscape Communications \251 1996\0"
RCDATA NP_INFO_OriginalFilename  { "NVAPI32.DLL" }
RCDATA NP_INFO_ProductName       { "NPAVI32 Dynamic Link Library\0" }
*/
/* RC_DATA types for version info - required */
#define NP_INFO_ProductVersion      1
#define NP_INFO_MIMEType            2
#define NP_INFO_FileOpenName        3
#define NP_INFO_FileExtents         4
/* RC_DATA types for version info - used if found */
#define NP_INFO_FileDescription     5
#define NP_INFO_ProductName         6
/* RC_DATA types for version info - optional */
#define NP_INFO_CompanyName         7
#define NP_INFO_FileVersion         8
#define NP_INFO_InternalName        9
#define NP_INFO_LegalCopyright      10
#define NP_INFO_OriginalFilename    11

#ifndef RC_INVOKED

/*----------------------------------------------------------------------*/
/*                       Definition of Basic Types                      */
/*----------------------------------------------------------------------*/

typedef unsigned char NPBool;
typedef int16_t       NPError;
typedef int16_t       NPReason;
typedef char*         NPMIMEType;

/*----------------------------------------------------------------------*/
/*                       Structures and definitions                     */
/*----------------------------------------------------------------------*/

#if !defined(__LP64__)
#if defined(XP_MACOSX)
#pragma options align=mac68k
#endif
#endif /* __LP64__ */

/*
 *  NPP is a plug-in's opaque instance handle
 */
typedef struct _NPP
{
  void* pdata;      /* plug-in private data */
  void* ndata;      /* netscape private data */
} NPP_t;

typedef NPP_t*  NPP;

typedef struct _NPStream
{
  void*    pdata; /* plug-in private data */
  void*    ndata; /* netscape private data */
  const    char* url;
  uint32_t end;
  uint32_t lastmodified;
  void*    notifyData;
  const    char* headers; /* Response headers from host.
                           * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
                           * Used for HTTP only; NULL for non-HTTP.
                           * Available from NPP_NewStream onwards.
                           * Plugin should copy this data before storing it.
                           * Includes HTTP status line and all headers,
                           * preferably verbatim as received from server,
                           * headers formatted as in HTTP ("Header: Value"),
                           * and newlines (\n, NOT \r\n) separating lines.
                           * Terminated by \n\0 (NOT \n\n\0). */
} NPStream;

typedef struct _NPByteRange
{
  int32_t  offset; /* negative offset means from the end */
  uint32_t length;
  struct _NPByteRange* next;
} NPByteRange;

typedef struct _NPSavedData
{
  int32_t len;
  void*   buf;
} NPSavedData;

typedef struct _NPRect
{
  uint16_t top;
  uint16_t left;
  uint16_t bottom;
  uint16_t right;
} NPRect;

typedef struct _NPSize
{
  int32_t width;
  int32_t height;
} NPSize;

typedef enum {
  NPFocusNext = 0,
  NPFocusPrevious = 1
} NPFocusDirection;

/* Return values for NPP_HandleEvent */
#define kNPEventNotHandled 0
#define kNPEventHandled 1
/* Exact meaning must be spec'd in event model. */
#define kNPEventStartIME 2

#if defined(XP_UNIX)
/*
 * Unix specific structures and definitions
 */

/*
 * Callback Structures.
 *
 * These are used to pass additional platform specific information.
 */
enum {
  NP_SETWINDOW = 1,
  NP_PRINT
};

typedef struct
{
  int32_t type;
} NPAnyCallbackStruct;

typedef struct
{
  int32_t      type;
#if defined(MOZ_X11)
  Display*     display;
  Visual*      visual;
  Colormap     colormap;
  unsigned int depth;
#endif
} NPSetWindowCallbackStruct;

typedef struct
{
  int32_t type;
  FILE* fp;
} NPPrintCallbackStruct;

#endif /* XP_UNIX */

#if defined(XP_MACOSX)
typedef enum {
#ifndef NP_NO_QUICKDRAW
  NPDrawingModelQuickDraw = 0,
#endif
  NPDrawingModelCoreGraphics = 1,
  NPDrawingModelOpenGL = 2,
  NPDrawingModelCoreAnimation = 3,
  NPDrawingModelInvalidatingCoreAnimation = 4
} NPDrawingModel;

typedef enum {
#ifndef NP_NO_CARBON
  NPEventModelCarbon = 0,
#endif
  NPEventModelCocoa = 1
} NPEventModel;
#endif

/*
 *   The following masks are applied on certain platforms to NPNV and
 *   NPPV selectors that pass around pointers to COM interfaces. Newer
 *   compilers on some platforms may generate vtables that are not
 *   compatible with older compilers. To prevent older plugins from
 *   not understanding a new browser's ABI, these masks change the
 *   values of those selectors on those platforms. To remain backwards
 *   compatible with different versions of the browser, plugins can
 *   use these masks to dynamically determine and use the correct C++
 *   ABI that the browser is expecting. This does not apply to Windows
 *   as Microsoft's COM ABI will likely not change.
 */

#define NP_ABI_GCC3_MASK  0x10000000
/*
 *   gcc 3.x generated vtables on UNIX and OSX are incompatible with
 *   previous compilers.
 */
#if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
#else
#define _NP_ABI_MIXIN_FOR_GCC3 0
#endif

#if defined(XP_MACOSX)
#define NP_ABI_MACHO_MASK 0x01000000
#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
#else
#define _NP_ABI_MIXIN_FOR_MACHO 0
#endif

#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)

/*
 * List of variable names for which NPP_GetValue shall be implemented
 */
typedef enum {
  NPPVpluginNameString = 1,
  NPPVpluginDescriptionString,
  NPPVpluginWindowBool,
  NPPVpluginTransparentBool,
  NPPVjavaClass,
  NPPVpluginWindowSize,
  NPPVpluginTimerInterval,
  NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
  NPPVpluginScriptableIID = 11,
  NPPVjavascriptPushCallerBool = 12,
  NPPVpluginKeepLibraryInMemory = 13,
  NPPVpluginNeedsXEmbed         = 14,

  /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
   */
  NPPVpluginScriptableNPObject  = 15,

  /* Get the plugin value (as \0-terminated UTF-8 string data) for
   * form submission if the plugin is part of a form. Use
   * NPN_MemAlloc() to allocate memory for the string data. Introduced
   * in NPAPI minor version 15.
   */
  NPPVformValue = 16,

  NPPVpluginUrlRequestsDisplayedBool = 17,

  /* Checks if the plugin is interested in receiving the http body of
   * all http requests (including failed ones, http status != 200).
   */
  NPPVpluginWantsAllNetworkStreams = 18,

  /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
  NPPVpluginNativeAccessibleAtkPlugId = 19,

  /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
  NPPVpluginCancelSrcStream = 20,

  NPPVSupportsAdvancedKeyHandling = 21

#if defined(XP_MACOSX)
  /* Used for negotiating drawing models */
  , NPPVpluginDrawingModel = 1000
  /* Used for negotiating event models */
  , NPPVpluginEventModel = 1001
  /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
  , NPPVpluginCoreAnimationLayer = 1003
#endif

#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
  , NPPVpluginWindowlessLocalBool = 2002
#endif
} NPPVariable;

/*
 * List of variable names for which NPN_GetValue should be implemented.
 */
typedef enum {
  NPNVxDisplay = 1,
  NPNVxtAppContext,
  NPNVnetscapeWindow,
  NPNVjavascriptEnabledBool,
  NPNVasdEnabledBool,
  NPNVisOfflineBool,

  NPNVserviceManager = (10 | NP_ABI_MASK),
  NPNVDOMElement     = (11 | NP_ABI_MASK),
  NPNVDOMWindow      = (12 | NP_ABI_MASK),
  NPNVToolkit        = (13 | NP_ABI_MASK),
  NPNVSupportsXEmbedBool = 14,

  /* Get the NPObject wrapper for the browser window. */
  NPNVWindowNPObject = 15,

  /* Get the NPObject wrapper for the plugins DOM element. */
  NPNVPluginElementNPObject = 16,

  NPNVSupportsWindowless = 17,

  NPNVprivateModeBool = 18,

  NPNVsupportsAdvancedKeyHandling = 21

#if defined(XP_MACOSX)
  /* Used for negotiating drawing models */
  , NPNVpluginDrawingModel = 1000
#ifndef NP_NO_QUICKDRAW
  , NPNVsupportsQuickDrawBool = 2000
#endif
  , NPNVsupportsCoreGraphicsBool = 2001
  , NPNVsupportsOpenGLBool = 2002
  , NPNVsupportsCoreAnimationBool = 2003
  , NPNVsupportsInvalidatingCoreAnimationBool = 2004
#ifndef NP_NO_CARBON
  , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
#endif
  , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
#endif
#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
  , NPNVSupportsWindowlessLocal = 2002
#endif
} NPNVariable;

typedef enum {
  NPNURLVCookie = 501,
  NPNURLVProxy
} NPNURLVariable;

/*
 * The type of Toolkit the widgets use
 */
typedef enum {
  NPNVGtk12 = 1,
  NPNVGtk2
} NPNToolkitType;

/*
 * The type of a NPWindow - it specifies the type of the data structure
 * returned in the window field.
 */
typedef enum {
  NPWindowTypeWindow = 1,
  NPWindowTypeDrawable
} NPWindowType;

typedef struct _NPWindow
{
  void* window;  /* Platform specific window handle */
                 /* OS/2: x - Position of bottom left corner */
                 /* OS/2: y - relative to visible netscape window */
  int32_t  x;      /* Position of top left corner relative */
  int32_t  y;      /* to a netscape page. */
  uint32_t width;  /* Maximum window size */
  uint32_t height;
  NPRect   clipRect; /* Clipping rectangle in port coordinates */
#if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
  void * ws_info; /* Platform-dependent additional data */
#endif /* XP_UNIX */
  NPWindowType type; /* Is this a window or a drawable? */
} NPWindow;

typedef struct _NPImageExpose
{
  char*    data;       /* image pointer */
  int32_t  stride;     /* Stride of data image pointer */
  int32_t  depth;      /* Depth of image pointer */
  int32_t  x;          /* Expose x */
  int32_t  y;          /* Expose y */
  uint32_t width;      /* Expose width */
  uint32_t height;     /* Expose height */
  NPSize   dataSize;   /* Data buffer size */
  float    translateX; /* translate X matrix value */
  float    translateY; /* translate Y matrix value */
  float    scaleX;     /* scale X matrix value */
  float    scaleY;     /* scale Y matrix value */
} NPImageExpose;

typedef struct _NPFullPrint
{
  NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
  NPBool printOne;     /* TRUE if plugin should print one copy to default
                          printer */
  void* platformPrint; /* Platform-specific printing info */
} NPFullPrint;

typedef struct _NPEmbedPrint
{
  NPWindow window;
  void* platformPrint; /* Platform-specific printing info */
} NPEmbedPrint;

typedef struct _NPPrint
{
  uint16_t mode;               /* NP_FULL or NP_EMBED */
  union
  {
    NPFullPrint fullPrint;   /* if mode is NP_FULL */
    NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
  } print;
} NPPrint;

#if defined(XP_MACOSX)
#ifndef NP_NO_CARBON
typedef EventRecord NPEvent;
#endif
#elif defined(XP_SYMBIAN)
typedef QEvent NPEvent;
#elif defined(XP_WIN)
typedef struct _NPEvent
{
  uint16_t event;
  uintptr_t wParam;
  uintptr_t lParam;
} NPEvent;
#elif defined(XP_OS2)
typedef struct _NPEvent
{
  uint32_t event;
  uint32_t wParam;
  uint32_t lParam;
} NPEvent;
#elif defined(XP_UNIX) && defined(MOZ_X11)
typedef XEvent NPEvent;
#else
typedef void*  NPEvent;
#endif

#if defined(XP_MACOSX)
typedef void* NPRegion;
#ifndef NP_NO_QUICKDRAW
typedef RgnHandle NPQDRegion;
#endif
typedef CGPathRef NPCGRegion;
#elif defined(XP_WIN)
typedef HRGN NPRegion;
#elif defined(XP_UNIX) && defined(MOZ_X11)
typedef Region NPRegion;
#elif defined(XP_SYMBIAN)
typedef QRegion* NPRegion;
#else
typedef void *NPRegion;
#endif

typedef struct _NPNSString NPNSString;
typedef struct _NPNSWindow NPNSWindow;
typedef struct _NPNSMenu   NPNSMenu;

#if defined(XP_MACOSX)
typedef NPNSMenu NPMenu;
#else
typedef void *NPMenu;
#endif

typedef enum {
  NPCoordinateSpacePlugin = 1,
  NPCoordinateSpaceWindow,
  NPCoordinateSpaceFlippedWindow,
  NPCoordinateSpaceScreen,
  NPCoordinateSpaceFlippedScreen
} NPCoordinateSpace;

#if defined(XP_MACOSX)

#ifndef NP_NO_QUICKDRAW
typedef struct NP_Port
{
  CGrafPtr port;
  int32_t portx; /* position inside the topmost window */
  int32_t porty;
} NP_Port;
#endif /* NP_NO_QUICKDRAW */

/*
 * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
 * as its drawing model.
 */

typedef struct NP_CGContext
{
  CGContextRef context;
  void *window; /* A WindowRef under the Carbon event model. */
} NP_CGContext;

/*
 * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
 * drawing model.
 */

typedef struct NP_GLContext
{
  CGLContextObj context;
#ifdef NP_NO_CARBON
  NPNSWindow *window;
#else
  void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
#endif
} NP_GLContext;

typedef enum {
  NPCocoaEventDrawRect = 1,
  NPCocoaEventMouseDown,
  NPCocoaEventMouseUp,
  NPCocoaEventMouseMoved,
  NPCocoaEventMouseEntered,
  NPCocoaEventMouseExited,
  NPCocoaEventMouseDragged,
  NPCocoaEventKeyDown,
  NPCocoaEventKeyUp,
  NPCocoaEventFlagsChanged,
  NPCocoaEventFocusChanged,
  NPCocoaEventWindowFocusChanged,
  NPCocoaEventScrollWheel,
  NPCocoaEventTextInput
} NPCocoaEventType;

typedef struct _NPCocoaEvent {
  NPCocoaEventType type;
  uint32_t version;
  union {
    struct {
      uint32_t modifierFlags;
      double   pluginX;
      double   pluginY;
      int32_t  buttonNumber;
      int32_t  clickCount;
      double   deltaX;
      double   deltaY;
      double   deltaZ;
    } mouse;
    struct {
      uint32_t    modifierFlags;
      NPNSString *characters;
      NPNSString *charactersIgnoringModifiers;
      NPBool      isARepeat;
      uint16_t    keyCode;
    } key;
    struct {
      CGContextRef context;
      double x;
      double y;
      double width;
      double height;
    } draw;
    struct {
      NPBool hasFocus;
    } focus;
    struct {
      NPNSString *text;
    } text;
  } data;
} NPCocoaEvent;

#ifndef NP_NO_CARBON
/* Non-standard event types that can be passed to HandleEvent */
enum NPEventType {
  NPEventType_GetFocusEvent = (osEvt + 16),
  NPEventType_LoseFocusEvent,
  NPEventType_AdjustCursorEvent,
  NPEventType_MenuCommandEvent,
  NPEventType_ClippingChangedEvent,
  NPEventType_ScrollingBeginsEvent = 1000,
  NPEventType_ScrollingEndsEvent
};
#endif /* NP_NO_CARBON */

#endif /* XP_MACOSX */

/*
 * Values for mode passed to NPP_New:
 */
#define NP_EMBED 1
#define NP_FULL  2

/*
 * Values for stream type passed to NPP_NewStream:
 */
#define NP_NORMAL     1
#define NP_SEEK       2
#define NP_ASFILE     3
#define NP_ASFILEONLY 4

#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)

#if !defined(__LP64__)
#if defined(XP_MACOSX)
#pragma options align=reset
#endif
#endif /* __LP64__ */

/*----------------------------------------------------------------------*/
/*       Error and Reason Code definitions                              */
/*----------------------------------------------------------------------*/

/*
 * Values of type NPError:
 */
#define NPERR_BASE                         0
#define NPERR_NO_ERROR                    (NPERR_BASE + 0)
#define NPERR_GENERIC_ERROR               (NPERR_BASE + 1)
#define NPERR_INVALID_INSTANCE_ERROR      (NPERR_BASE + 2)
#define NPERR_INVALID_FUNCTABLE_ERROR     (NPERR_BASE + 3)
#define NPERR_MODULE_LOAD_FAILED_ERROR    (NPERR_BASE + 4)
#define NPERR_OUT_OF_MEMORY_ERROR         (NPERR_BASE + 5)
#define NPERR_INVALID_PLUGIN_ERROR        (NPERR_BASE + 6)
#define NPERR_INVALID_PLUGIN_DIR_ERROR    (NPERR_BASE + 7)
#define NPERR_INCOMPATIBLE_VERSION_ERROR  (NPERR_BASE + 8)
#define NPERR_INVALID_PARAM               (NPERR_BASE + 9)
#define NPERR_INVALID_URL                 (NPERR_BASE + 10)
#define NPERR_FILE_NOT_FOUND              (NPERR_BASE + 11)
#define NPERR_NO_DATA                     (NPERR_BASE + 12)
#define NPERR_STREAM_NOT_SEEKABLE         (NPERR_BASE + 13)

/*
 * Values of type NPReason:
 */
#define NPRES_BASE          0
#define NPRES_DONE         (NPRES_BASE + 0)
#define NPRES_NETWORK_ERR  (NPRES_BASE + 1)
#define NPRES_USER_BREAK   (NPRES_BASE + 2)

/*
 * Don't use these obsolete error codes any more.
 */
#define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK

/*
 * Version feature information
 */
#define NPVERS_HAS_STREAMOUTPUT             8
#define NPVERS_HAS_NOTIFICATION             9
#define NPVERS_HAS_LIVECONNECT              9
#define NPVERS_68K_HAS_LIVECONNECT          11
#define NPVERS_HAS_WINDOWLESS               11
#define NPVERS_HAS_XPCONNECT_SCRIPTING      13
#define NPVERS_HAS_NPRUNTIME_SCRIPTING      14
#define NPVERS_HAS_FORM_VALUES              15
#define NPVERS_HAS_POPUPS_ENABLED_STATE     16
#define NPVERS_HAS_RESPONSE_HEADERS         17
#define NPVERS_HAS_NPOBJECT_ENUM            18
#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
#define NPVERS_HAS_ALL_NETWORK_STREAMS      20
#define NPVERS_HAS_URL_AND_AUTH_INFO        21
#define NPVERS_HAS_PRIVATE_MODE             22
#define NPVERS_MACOSX_HAS_COCOA_EVENTS      23
#define NPVERS_HAS_ADVANCED_KEY_HANDLING    25
#define NPVERS_HAS_URL_REDIRECT_HANDLING    26

/*----------------------------------------------------------------------*/
/*                        Function Prototypes                           */
/*----------------------------------------------------------------------*/

#if defined(__OS2__)
#define NP_LOADDS _System
#else
#define NP_LOADDS
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* NPP_* functions are provided by the plugin and called by the navigator. */

#if defined(XP_UNIX)
char* NPP_GetMIMEDescription(void);
#endif

NPError NP_LOADDS NPP_Initialize(void);
void    NP_LOADDS NPP_Shutdown(void);
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
                          uint16_t mode, int16_t argc, char* argn[],
                          char* argv[], NPSavedData* saved);
NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
                                NPStream* stream, NPBool seekable,
                                uint16_t* stype);
NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
                                    NPReason reason);
int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
                            int32_t len, void* buffer);
void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
                                   const char* fname);
void    NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
void    NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
                                NPReason reason, void* notifyData);
NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
NPBool  NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
void    NP_LOADDS NPP_LostFocus(NPP instance);
void    NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);

/* NPN_* functions are provided by the navigator and called by the plugin. */
void        NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
                                  int* netscape_major, int* netscape_minor);
NPError     NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
                                       const char* target, void* notifyData);
NPError     NP_LOADDS NPN_GetURL(NPP instance, const char* url,
                                 const char* target);
NPError     NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
                                        const char* target, uint32_t len,
                                        const char* buf, NPBool file,
                                        void* notifyData);
NPError     NP_LOADDS NPN_PostURL(NPP instance, const char* url,
                                  const char* target, uint32_t len,
                                  const char* buf, NPBool file);
NPError     NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
NPError     NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
                                    const char* target, NPStream** stream);
int32_t     NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
                                void* buffer);
NPError     NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream,
                                        NPReason reason);
void        NP_LOADDS NPN_Status(NPP instance, const char* message);
const char* NP_LOADDS NPN_UserAgent(NPP instance);
void*       NP_LOADDS NPN_MemAlloc(uint32_t size);
void        NP_LOADDS NPN_MemFree(void* ptr);
uint32_t    NP_LOADDS NPN_MemFlush(uint32_t size);
void        NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
NPError     NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
                                   void *value);
NPError     NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
                                   void *value);
void        NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
void        NP_LOADDS NPN_InvalidateRegion(NPP instance,
                                           NPRegion invalidRegion);
void        NP_LOADDS NPN_ForceRedraw(NPP instance);
void        NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
void        NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
void        NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
                                                void (*func) (void *),
                                                void *userData);
NPError     NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
                                         const char *url, char **value,
                                         uint32_t *len);
NPError     NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
                                         const char *url, const char *value,
                                         uint32_t len);
NPError     NP_LOADDS NPN_GetAuthenticationInfo(NPP instance,
                                                const char *protocol,
                                                const char *host, int32_t port,
                                                const char *scheme,
                                                const char *realm,
                                                char **username, uint32_t *ulen,
                                                char **password,
                                                uint32_t *plen);
uint32_t    NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
void        NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
NPError     NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
NPBool      NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
NPBool      NP_LOADDS NPN_HandleEvent(NPP instance, void *event, NPBool handled);
NPBool      NP_LOADDS NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
void        NP_LOADDS NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);

#ifdef __cplusplus
}  /* end extern "C" */
#endif

#endif /* RC_INVOKED */
#if defined(__OS2__)
#pragma pack()
#endif

#endif /* npapi_h_ */

================================================
FILE: plugin/npfunctions.h
================================================
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef npfunctions_h_
#define npfunctions_h_

#ifdef __OS2__
#pragma pack(1)
#define NP_LOADDS _System
#else
#define NP_LOADDS
#endif

#include "npapi.h"
#include "npruntime.h"

typedef void         (* NP_LOADDS NPP_InitializeProcPtr)();
typedef void         (* NP_LOADDS NPP_ShutdownProcPtr)();
typedef NPError      (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
typedef NPError      (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
typedef NPError      (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
typedef NPError      (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
typedef NPError      (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
typedef int32_t      (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
typedef int32_t      (* NP_LOADDS NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
typedef void         (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
typedef void         (* NP_LOADDS NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
typedef int16_t      (* NP_LOADDS NPP_HandleEventProcPtr)(NPP instance, void* event);
typedef void         (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance, const char* url, NPReason reason, void* notifyData);
/* Any NPObjects returned to the browser via NPP_GetValue should be retained
   by the plugin on the way out. The browser is responsible for releasing. */
typedef NPError      (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
typedef NPError      (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);

typedef NPError      (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
typedef NPError      (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
typedef NPError      (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url, const char* window, void* notifyData);
typedef NPError      (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData);
typedef NPError      (*NPN_GetURLProcPtr)(NPP instance, const char* url, const char* window);
typedef NPError      (*NPN_PostURLProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file);
typedef NPError      (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
typedef NPError      (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
typedef int32_t      (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32_t len, void* buffer);
typedef NPError      (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
typedef void         (*NPN_StatusProcPtr)(NPP instance, const char* message);
/* Browser manages the lifetime of the buffer returned by NPN_UserAgent, don't
   depend on it sticking around and don't free it. */
typedef const char*  (*NPN_UserAgentProcPtr)(NPP instance);
typedef void*        (*NPN_MemAllocProcPtr)(uint32_t size);
typedef void         (*NPN_MemFreeProcPtr)(void* ptr);
typedef uint32_t     (*NPN_MemFlushProcPtr)(uint32_t size);
typedef void         (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
typedef void*        (*NPN_GetJavaEnvProcPtr)();
typedef void*        (*NPN_GetJavaPeerProcPtr)(NPP instance);
typedef void         (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
typedef void         (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
typedef void         (*NPN_ForceRedrawProcPtr)(NPP instance);
typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr)(const NPUTF8* name);
typedef void         (*NPN_GetStringIdentifiersProcPtr)(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers);
typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr)(int32_t intid);
typedef bool         (*NPN_IdentifierIsStringProcPtr)(NPIdentifier identifier);
typedef NPUTF8*      (*NPN_UTF8FromIdentifierProcPtr)(NPIdentifier identifier);
typedef int32_t      (*NPN_IntFromIdentifierProcPtr)(NPIdentifier identifier);
typedef NPObject*    (*NPN_CreateObjectProcPtr)(NPP npp, NPClass *aClass);
typedef NPObject*    (*NPN_RetainObjectProcPtr)(NPObject *obj);
typedef void         (*NPN_ReleaseObjectProcPtr)(NPObject *obj);
typedef bool         (*NPN_InvokeProcPtr)(NPP npp, NPObject* obj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result);
typedef bool         (*NPN_InvokeDefaultProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
typedef bool         (*NPN_EvaluateProcPtr)(NPP npp, NPObject *obj, NPString *script, NPVariant *result);
typedef bool         (*NPN_GetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result);
typedef bool         (*NPN_SetPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value);
typedef bool         (*NPN_RemovePropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
typedef bool         (*NPN_HasPropertyProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
typedef bool         (*NPN_HasMethodProcPtr)(NPP npp, NPObject *obj, NPIdentifier propertyName);
typedef void         (*NPN_ReleaseVariantValueProcPtr)(NPVariant *variant);
typedef void         (*NPN_SetExceptionProcPtr)(NPObject *obj, const NPUTF8 *message);
typedef bool         (*NPN_PushPopupsEnabledStateProcPtr)(NPP npp, NPBool enabled);
typedef bool         (*NPN_PopPopupsEnabledStateProcPtr)(NPP npp);
typedef bool         (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj, NPIdentifier **identifier, uint32_t *count);
typedef void         (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, void (*func)(void *), void *userData);
typedef bool         (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
typedef NPError      (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, char **value, uint32_t *len);
typedef NPError      (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable variable, const char *url, const char *value, uint32_t len);
typedef NPError      (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen);

typedef struct _NPPluginFuncs {
  uint16_t size;
  uint16_t version;
  NPP_NewProcPtr newp;
  NPP_DestroyProcPtr destroy;
  NPP_SetWindowProcPtr setwindow;
  NPP_NewStreamProcPtr newstream;
  NPP_DestroyStreamProcPtr destroystream;
  NPP_StreamAsFileProcPtr asfile;
  NPP_WriteReadyProcPtr writeready;
  NPP_WriteProcPtr write;
  NPP_PrintProcPtr print;
  NPP_HandleEventProcPtr event;
  NPP_URLNotifyProcPtr urlnotify;
  void* javaClass;
  NPP_GetValueProcPtr getvalue;
  NPP_SetValueProcPtr setvalue;
} NPPluginFuncs;

typedef struct _NPNetscapeFuncs {
  uint16_t size;
  uint16_t version;
  NPN_GetURLProcPtr geturl;
  NPN_PostURLProcPtr posturl;
  NPN_RequestReadProcPtr requestread;
  NPN_NewStreamProcPtr newstream;
  NPN_WriteProcPtr write;
  NPN_DestroyStreamProcPtr destroystream;
  NPN_StatusProcPtr status;
  NPN_UserAgentProcPtr uagent;
  NPN_MemAllocProcPtr memalloc;
  NPN_MemFreeProcPtr memfree;
  NPN_MemFlushProcPtr memflush;
  NPN_ReloadPluginsProcPtr reloadplugins;
  NPN_GetJavaEnvProcPtr getJavaEnv;
  NPN_GetJavaPeerProcPtr getJavaPeer;
  NPN_GetURLNotifyProcPtr geturlnotify;
  NPN_PostURLNotifyProcPtr posturlnotify;
  NPN_GetValueProcPtr getvalue;
  NPN_SetValueProcPtr setvalue;
  NPN_InvalidateRectProcPtr invalidaterect;
  NPN_InvalidateRegionProcPtr invalidateregion;
  NPN_ForceRedrawProcPtr forceredraw;
  NPN_GetStringIdentifierProcPtr getstringidentifier;
  NPN_GetStringIdentifiersProcPtr getstringidentifiers;
  NPN_GetIntIdentifierProcPtr getintidentifier;
  NPN_IdentifierIsStringProcPtr identifierisstring;
  NPN_UTF8FromIdentifierProcPtr utf8fromidentifier;
  NPN_IntFromIdentifierProcPtr intfromidentifier;
  NPN_CreateObjectProcPtr createobject;
  NPN_RetainObjectProcPtr retainobject;
  NPN_ReleaseObjectProcPtr releaseobject;
  NPN_InvokeProcPtr invoke;
  NPN_InvokeDefaultProcPtr invokeDefault;
  NPN_EvaluateProcPtr evaluate;
  NPN_GetPropertyProcPtr getproperty;
  NPN_SetPropertyProcPtr setproperty;
  NPN_RemovePropertyProcPtr removeproperty;
  NPN_HasPropertyProcPtr hasproperty;
  NPN_HasMethodProcPtr hasmethod;
  NPN_ReleaseVariantValueProcPtr releasevariantvalue;
  NPN_SetExceptionProcPtr setexception;
  NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate;
  NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate;
  NPN_EnumerateProcPtr enumerate;
  NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall;
  NPN_ConstructProcPtr construct;
  NPN_GetValueForURLPtr getvalueforurl;
  NPN_SetValueForURLPtr setvalueforurl;
  NPN_GetAuthenticationInfoPtr getauthenticationinfo;
} NPNetscapeFuncs;

#ifdef XP_MACOSX
/*
 * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
 * These can be called to retreive MIME information from the plugin dynamically
 *
 * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
 *       to get mime info from the plugin only on OSX and may not be supported
 *       in furture version -- use NP_GetMIMEDescription instead
 */
enum
{
 kBPSupportedMIMETypesStructVers_1    = 1
};
typedef struct _BPSupportedMIMETypes
{
 SInt32    structVersion;      /* struct version */
 Handle    typeStrings;        /* STR# formated handle, allocated by plug-in */
 Handle    infoStrings;        /* STR# formated handle, allocated by plug-in */
} BPSupportedMIMETypes;
OSErr BP_GetSupportedMIMETypes(BPSupportedMIMETypes *mimeInfo, UInt32 flags);
#define NP_GETMIMEDESCRIPTION_NAME "NP_GetMIMEDescription"
typedef const char* (*NP_GetMIMEDescriptionProcPtr)();
typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, UInt32);
#endif

#if defined(_WINDOWS)
#define OSCALL WINAPI
#else
#if defined(__OS2__)
#define OSCALL _System
#else
#define OSCALL
#endif
#endif

#if defined(XP_UNIX)
/* GCC 3.3 and later support the visibility attribute. */
#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
#define NP_VISIBILITY_DEFAULT __attribute__((visibility("default")))
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#define NP_VISIBILITY_DEFAULT __global
#else
#define NP_VISIBILITY_DEFAULT
#endif
#define NP_EXPORT(__type) NP_VISIBILITY_DEFAULT __type
#endif

#if defined(_WINDOWS) || defined (__OS2__)
#ifdef __cplusplus
extern "C" {
#endif
/* plugin meta member functions */
#if defined(__OS2__)
typedef struct _NPPluginData {   /* Alternate OS2 Plugin interface */
  char *pMimeTypes;
  char *pFileExtents;
  char *pFileOpenTemplate;
  char *pProductName;
  char *pProductDescription;
  unsigned long dwProductVersionMS;
  unsigned long dwProductVersionLS;
} NPPluginData;
NPError OSCALL NP_GetPluginData(NPPluginData * pPluginData);
#endif
NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* pFuncs);
NPError OSCALL NP_Initialize(NPNetscapeFuncs* bFuncs);
NPError OSCALL NP_Shutdown();
char*          NP_GetMIMEDescription();
#ifdef __cplusplus
}
#endif
#endif

#if defined(__OS2__)
#pragma pack()
#endif

#ifdef XP_UNIX
#ifdef __cplusplus
extern "C" {
#endif
NP_EXPORT(char*)   NP_GetPluginVersion();
NP_EXPORT(char*)   NP_GetMIMEDescription();
#ifdef XP_MACOSX
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
#else
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
#endif
NP_EXPORT(NPError) NP_Shutdown();
NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
#ifdef __cplusplus
}
#endif
#endif

#endif /* npfunctions_h_ */


================================================
FILE: plugin/npn_entry.cc
================================================
#include "npfunctions.h"

NPNetscapeFuncs* g_npn_funcs;

void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor) {
    *plugin_major = 1;
    *plugin_minor = 1;
    *netscape_major = g_npn_funcs->version >> 8;
    *netscape_minor = g_npn_funcs->version & 0x00FF;
}

NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData) {
    return g_npn_funcs->geturlnotify(instance, url, target, notifyData);
}

NPError NP_LOADDS NPN_GetURL(NPP instance,const char* url,const char* target) {
    return g_npn_funcs->geturl(instance, url, target);
}

NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData) {
    return g_npn_funcs->posturlnotify(instance, url, target, len, buf, file, notifyData);
}

NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,const char* target, uint32_t len,const char* buf, NPBool file) {
    return g_npn_funcs->posturl(instance, url, target, len, buf, file);
}

NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) {
    return g_npn_funcs->requestread(stream, rangeList);
}

NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream) {
    return g_npn_funcs->newstream(instance, type, target, stream);
}

int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer) {
    return g_npn_funcs->write(instance, stream, len, buffer);
}

NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason) {
    return g_npn_funcs->destroystream(instance, stream, reason);
}

void NP_LOADDS NPN_Status(NPP instance, const char* message) {
    g_npn_funcs->status(instance, message);
}

const char* NP_LOADDS NPN_UserAgent(NPP instance) {
    return g_npn_funcs->uagent(instance);
}

void* NP_LOADDS NPN_MemAlloc(uint32_t size) {
    return g_npn_funcs->memalloc(size);
}

void NP_LOADDS NPN_MemFree(void* ptr) {
    return g_npn_funcs->memfree(ptr);
}

uint32_t NP_LOADDS NPN_MemFlush(uint32_t size) {
    return g_npn_funcs->memflush(size);
}

void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages) {
    g_npn_funcs->reloadplugins(reloadPages);
}

NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value) {
    return g_npn_funcs->getvalue(instance, variable, value);
}

NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value) {
    return g_npn_funcs->setvalue(instance, variable, value);
}

void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect) {
    g_npn_funcs->invalidaterect(instance, invalidRect);
}

void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) {
    g_npn_funcs->invalidateregion(instance, invalidRegion);
}

void NP_LOADDS NPN_ForceRedraw(NPP instance) {
    g_npn_funcs->forceredraw(instance);
}

void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) {
    g_npn_funcs->pushpopupsenabledstate(instance, enabled);
}

void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance) {
    g_npn_funcs->poppopupsenabledstate(instance);
}
void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,void (*func) (void *), void *userData) {
    g_npn_funcs->pluginthreadasynccall(instance, func, userData);
}

NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char *url, char **value, uint32_t *len) {
    return g_npn_funcs->getvalueforurl(instance, variable, url, value, len);
}

NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char *url, const char *value, uint32_t len) {
    return g_npn_funcs->setvalueforurl(instance, variable, url, value, len);
}
NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen) {
    return g_npn_funcs->getauthenticationinfo(instance, protocol, host, port, scheme, realm, username, ulen, password, plen);
}

NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) {
    return g_npn_funcs->createobject(npp, aClass);
}

NPObject *NPN_RetainObject(NPObject *npobj) {
    return g_npn_funcs->retainobject(npobj);
}

void NPN_ReleaseObject(NPObject *npobj) {
    g_npn_funcs->releaseobject(npobj);
}

bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    return g_npn_funcs->invoke(npp, npobj, methodName, args, argCount, result);
}

bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    return g_npn_funcs->invokeDefault(npp, npobj, args, argCount, result);
}

bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) {
    return g_npn_funcs->evaluate(npp, npobj, script, result);
}

bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result) {
    return g_npn_funcs->getproperty(npp, npobj, propertyName, result);
}

bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value) {
    return g_npn_funcs->setproperty(npp, npobj, propertyName, value);
}

bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) {
    return g_npn_funcs->removeproperty(npp, npobj, propertyName);
}

bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) {
    return g_npn_funcs->hasproperty(npp, npobj, propertyName);
}

bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName) {
    return g_npn_funcs->hasmethod(npp, npobj, methodName);
}

bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count) {
    return g_npn_funcs->enumerate(npp, npobj, identifier, count);
}

bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    return g_npn_funcs->construct(npp, npobj, args, argCount, result);
}

void NPN_SetException(NPObject *npobj, const NPUTF8 *message) {
    g_npn_funcs->setexception(npobj, message);
}

NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) {
    return g_npn_funcs->getstringidentifier(name);
}

void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) {
    g_npn_funcs->getstringidentifiers(names, nameCount, identifiers);
}

NPIdentifier NPN_GetIntIdentifier(int32_t intid) {
    return g_npn_funcs->getintidentifier(intid);
}

bool NPN_IdentifierIsString(NPIdentifier identifier) {
    return g_npn_funcs->identifierisstring(identifier);
}

NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) {
    return g_npn_funcs->utf8fromidentifier(identifier);
}

int32_t NPN_IntFromIdentifier(NPIdentifier identifier) {
    return g_npn_funcs->intfromidentifier(identifier);
}

void NPN_ReleaseVariantValue(NPVariant *variant) {
    g_npn_funcs->releasevariantvalue(variant);
}


================================================
FILE: plugin/npp_entry.cc
================================================
#include "log.h"
#include "npfunctions.h"
#include "plugin_base.h"
#include "plugin_factory.h"

extern Log g_logger;

#ifdef XP_UNIX
char* NPP_GetMIMEDescription() {
    return "";
}
#endif

NPError NP_LOADDS NPP_Initialize() {
    return NPERR_NO_ERROR;
}

void NP_LOADDS NPP_Shutdown() {
}

NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
    g_logger.WriteLog("msg", "NPP_New");
    PluginBase* pPlugin = PluginFactory::NewPlugin(pluginType);
    if (pPlugin == NULL)
        return NPERR_OUT_OF_MEMORY_ERROR;
    else
        return pPlugin->Init(instance, mode, argc, argn, argv, saved);
}

NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save) {
    g_logger.WriteLog("msg", "NPP_Destory");
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->UnInit(save);
}

NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->SetWindow(window);
}

NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->NewStream(type, stream, seekable, stype);
}

NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->DestroyStream(stream, reason);
}

int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->WriteReady(stream);
}

int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->Write(stream, offset, len, buffer);
}

void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    pPlugin->StreamAsFile(stream, fname);
}

void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    pPlugin->Print(platformPrint);
}

int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->HandleEvent(event);
}

void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    pPlugin->URLNotify(url, reason, notifyData);
}

NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value) {
    if (instance == NULL) {
        if (variable == NPPVpluginNameString)
            *((const char **)value) = "Chrome Fiddler";
        else if (variable == NPPVpluginDescriptionString)
            *((const char **)value) = "Chrome Fiddler Plugin";
        else
            return NPERR_GENERIC_ERROR;
    } else {
        PluginBase* pPlugin = (PluginBase*)instance->pdata;
        return pPlugin->GetValue(variable, value);
    }
    return NPERR_NO_ERROR;
}

NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value) {
    PluginBase* pPlugin = (PluginBase*)instance->pdata;
    return pPlugin->SetValue(variable, value);
}


================================================
FILE: plugin/npruntime.h
================================================
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
 * Foundation ("Mozilla") nor the names of their contributors may be used
 * to endorse or promote products derived from this software without
 * specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
 * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Revision 1 (March 4, 2004):
 * Initial proposal.
 *
 * Revision 2 (March 10, 2004):
 * All calls into script were made asynchronous.  Results are
 * provided via the NPScriptResultFunctionPtr callback.
 *
 * Revision 3 (March 10, 2004):
 * Corrected comments to not refer to class retain/release FunctionPtrs.
 *
 * Revision 4 (March 11, 2004):
 * Added additional convenience NPN_SetExceptionWithUTF8().
 * Changed NPHasPropertyFunctionPtr and NPHasMethodFunctionPtr to take NPClass
 * pointers instead of NPObject pointers.
 * Added NPIsValidIdentifier().
 *
 * Revision 5 (March 17, 2004):
 * Added context parameter to result callbacks from ScriptObject functions.
 *
 * Revision 6 (March 29, 2004):
 * Renamed functions implemented by user agent to NPN_*.  Removed _ from
 * type names.
 * Renamed "JavaScript" types to "Script".
 *
 * Revision 7 (April 21, 2004):
 * NPIdentifier becomes a void*, was int32_t
 * Remove NP_IsValidIdentifier, renamed NP_IdentifierFromUTF8 to NP_GetIdentifier
 * Added NPVariant and modified functions to use this new type.
 *
 * Revision 8 (July 9, 2004):
 * Updated to joint Apple-Mozilla license.
 *
 */
#ifndef _NP_RUNTIME_H_
#define _NP_RUNTIME_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "nptypes.h"

/*
    This API is used to facilitate binding code written in C to script
    objects.  The API in this header does not assume the presence of a
    user agent.  That is, it can be used to bind C code to scripting
    environments outside of the context of a user agent.

    However, the normal use of the this API is in the context of a
    scripting environment running in a browser or other user agent.
    In particular it is used to support the extended Netscape
    script-ability API for plugins (NP-SAP).  NP-SAP is an extension
    of the Netscape plugin API.  As such we have adopted the use of
    the "NP" prefix for this API.

    The following NP{N|P}Variables were added to the Netscape plugin
    API (in npapi.h):

    NPNVWindowNPObject
    NPNVPluginElementNPObject
    NPPVpluginScriptableNPObject

    These variables are exposed through NPN_GetValue() and
    NPP_GetValue() (respectively) and are used to establish the
    initial binding between the user agent and native code.  The DOM
    objects in the user agent can be examined and manipulated using
    the NPN_ functions that operate on NPObjects described in this
    header.

    To the extent possible the assumptions about the scripting
    language used by the scripting environment have been minimized.
*/

#define NP_BEGIN_MACRO  do {
#define NP_END_MACRO    } while (0)

/*
    Objects (non-primitive data) passed between 'C' and script is
    always wrapped in an NPObject.  The 'interface' of an NPObject is
    described by an NPClass.
*/
typedef struct NPObject NPObject;
typedef struct NPClass NPClass;

typedef char NPUTF8;
typedef struct _NPString {
    const NPUTF8 *UTF8Characters;
    uint32_t UTF8Length;
} NPString;

typedef enum {
    NPVariantType_Void,
    NPVariantType_Null,
    NPVariantType_Bool,
    NPVariantType_Int32,
    NPVariantType_Double,
    NPVariantType_String,
    NPVariantType_Object
} NPVariantType;

typedef struct _NPVariant {
    NPVariantType type;
    union {
        bool boolValue;
        int32_t intValue;
        double doubleValue;
        NPString stringValue;
        NPObject *objectValue;
    } value;
} NPVariant;

/*
    NPN_ReleaseVariantValue is called on all 'out' parameters
    references.  Specifically it is to be called on variants that own
    their value, as is the case with all non-const NPVariant*
    arguments after a successful call to any methods (except this one)
    in this API.

    After calling NPN_ReleaseVariantValue, the type of the variant
    will be NPVariantType_Void.
*/
void NPN_ReleaseVariantValue(NPVariant *variant);

#define NPVARIANT_IS_VOID(_v)    ((_v).type == NPVariantType_Void)
#define NPVARIANT_IS_NULL(_v)    ((_v).type == NPVariantType_Null)
#define NPVARIANT_IS_BOOLEAN(_v) ((_v).type == NPVariantType_Bool)
#define NPVARIANT_IS_INT32(_v)   ((_v).type == NPVariantType_Int32)
#define NPVARIANT_IS_DOUBLE(_v)  ((_v).type == NPVariantType_Double)
#define NPVARIANT_IS_STRING(_v)  ((_v).type == NPVariantType_String)
#define NPVARIANT_IS_OBJECT(_v)  ((_v).type == NPVariantType_Object)

#define NPVARIANT_TO_BOOLEAN(_v) ((_v).value.boolValue)
#define NPVARIANT_TO_INT32(_v)   ((_v).value.intValue)
#define NPVARIANT_TO_DOUBLE(_v)  ((_v).value.doubleValue)
#define NPVARIANT_TO_STRING(_v)  ((_v).value.stringValue)
#define NPVARIANT_TO_OBJECT(_v)  ((_v).value.objectValue)

#define VOID_TO_NPVARIANT(_v)                                                 \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Void;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO

#define NULL_TO_NPVARIANT(_v)                                                 \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Null;                                           \
    (_v).value.objectValue = NULL;                                            \
NP_END_MACRO

#define BOOLEAN_TO_NPVARIANT(_val, _v)                                        \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Bool;                                           \
    (_v).value.boolValue = !!(_val);                                          \
NP_END_MACRO

#define INT32_TO_NPVARIANT(_val, _v)                                          \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Int32;                                          \
    (_v).value.intValue = _val;                                               \
NP_END_MACRO

#define DOUBLE_TO_NPVARIANT(_val, _v)                                         \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Double;                                         \
    (_v).value.doubleValue = _val;                                            \
NP_END_MACRO

#define STRINGZ_TO_NPVARIANT(_val, _v)                                        \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, strlen(_val) };                                    \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO

#define STRINGN_TO_NPVARIANT(_val, _len, _v)                                  \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_String;                                         \
    NPString str = { _val, _len };                                            \
    (_v).value.stringValue = str;                                             \
NP_END_MACRO

#define OBJECT_TO_NPVARIANT(_val, _v)                                         \
NP_BEGIN_MACRO                                                                \
    (_v).type = NPVariantType_Object;                                         \
    (_v).value.objectValue = _val;                                            \
NP_END_MACRO


/*
  Type mappings (JavaScript types have been used for illustration
    purposes):

  JavaScript       to             C (NPVariant with type:)
  undefined                       NPVariantType_Void
  null                            NPVariantType_Null
  Boolean                         NPVariantType_Bool
  Number                          NPVariantType_Double or NPVariantType_Int32
  String                          NPVariantType_String
  Object                          NPVariantType_Object

  C (NPVariant with type:)   to   JavaScript
  NPVariantType_Void              undefined
  NPVariantType_Null              null
  NPVariantType_Bool              Boolean
  NPVariantType_Int32             Number
  NPVariantType_Double            Number
  NPVariantType_String            String
  NPVariantType_Object            Object
*/

typedef void *NPIdentifier;

/*
    NPObjects have methods and properties.  Methods and properties are
    identified with NPIdentifiers.  These identifiers may be reflected
    in script.  NPIdentifiers can be either strings or integers, IOW,
    methods and properties can be identified by either strings or
    integers (i.e. foo["bar"] vs foo[1]). NPIdentifiers can be
    compared using ==.  In case of any errors, the requested
    NPIdentifier(s) will be NULL. NPIdentifier lifetime is controlled
    by the browser. Plugins do not need to worry about memory management
    with regards to NPIdentifiers.
*/
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name);
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
                              NPIdentifier *identifiers);
NPIdentifier NPN_GetIntIdentifier(int32_t intid);
bool NPN_IdentifierIsString(NPIdentifier identifier);

/*
    The NPUTF8 returned from NPN_UTF8FromIdentifier SHOULD be freed.
*/
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier);

/*
    Get the integer represented by identifier. If identifier is not an
    integer identifier, the behaviour is undefined.
*/
int32_t NPN_IntFromIdentifier(NPIdentifier identifier);

/*
    NPObject behavior is implemented using the following set of
    callback functions.

    The NPVariant *result argument of these functions (where
    applicable) should be released using NPN_ReleaseVariantValue().
*/
typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass);
typedef void (*NPDeallocateFunctionPtr)(NPObject *npobj);
typedef void (*NPInvalidateFunctionPtr)(NPObject *npobj);
typedef bool (*NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name);
typedef bool (*NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name,
                                    const NPVariant *args, uint32_t argCount,
                                    NPVariant *result);
typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject *npobj,
                                           const NPVariant *args,
                                           uint32_t argCount,
                                           NPVariant *result);
typedef bool (*NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name);
typedef bool (*NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
                                         NPVariant *result);
typedef bool (*NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name,
                                         const NPVariant *value);
typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj,
                                            NPIdentifier name);
typedef bool (*NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value,
                                         uint32_t *count);
typedef bool (*NPConstructFunctionPtr)(NPObject *npobj,
                                       const NPVariant *args,
                                       uint32_t argCount,
                                       NPVariant *result);

/*
    NPObjects returned by create, retain, invoke, and getProperty pass
    a reference count to the caller.  That is, the callee adds a
    reference count which passes to the caller.  It is the caller's
    responsibility to release the returned object.

    NPInvokeFunctionPtr function may return 0 to indicate a void
    result.

    NPInvalidateFunctionPtr is called by the scripting environment
    when the native code is shutdown.  Any attempt to message a
    NPObject instance after the invalidate callback has been
    called will result in undefined behavior, even if the native code
    is still retaining those NPObject instances.  (The runtime
    will typically return immediately, with 0 or NULL, from an attempt
    to dispatch to a NPObject, but this behavior should not be
    depended upon.)

    The NPEnumerationFunctionPtr function may pass an array of
    NPIdentifiers back to the caller. The callee allocs the memory of
    the array using NPN_MemAlloc(), and it's the caller's responsibility
    to release it using NPN_MemFree().
*/
struct NPClass
{
    uint32_t structVersion;
    NPAllocateFunctionPtr allocate;
    NPDeallocateFunctionPtr deallocate;
    NPInvalidateFunctionPtr invalidate;
    NPHasMethodFunctionPtr hasMethod;
    NPInvokeFunctionPtr invoke;
    NPInvokeDefaultFunctionPtr invokeDefault;
    NPHasPropertyFunctionPtr hasProperty;
    NPGetPropertyFunctionPtr getProperty;
    NPSetPropertyFunctionPtr setProperty;
    NPRemovePropertyFunctionPtr removeProperty;
    NPEnumerationFunctionPtr enumerate;
    NPConstructFunctionPtr construct;
};

#define NP_CLASS_STRUCT_VERSION      3

#define NP_CLASS_STRUCT_VERSION_ENUM 2
#define NP_CLASS_STRUCT_VERSION_CTOR 3

#define NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass)   \
        ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM)

#define NP_CLASS_STRUCT_VERSION_HAS_CTOR(npclass)   \
        ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR)

struct NPObject {
    NPClass *_class;
    uint32_t referenceCount;
    /*
     * Additional space may be allocated here by types of NPObjects
     */
};

/*
    If the class has an allocate function, NPN_CreateObject invokes
    that function, otherwise a NPObject is allocated and
    returned. This method will initialize the referenceCount member of
    the NPObject to 1.
*/
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass);

/*
    Increment the NPObject's reference count.
*/
NPObject *NPN_RetainObject(NPObject *npobj);

/*
    Decremented the NPObject's reference count.  If the reference
    count goes to zero, the class's destroy function is invoke if
    specified, otherwise the object is freed directly.
*/
void NPN_ReleaseObject(NPObject *npobj);

/*
    Functions to access script objects represented by NPObject.

    Calls to script objects are synchronous.  If a function returns a
    value, it will be supplied via the result NPVariant
    argument. Successful calls will return true, false will be
    returned in case of an error.

    Calls made from plugin code to script must be made from the thread
    on which the plugin was initialized.
*/

bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
                const NPVariant *args, uint32_t argCount, NPVariant *result);
bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
                       uint32_t argCount, NPVariant *result);
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
                  NPVariant *result);
bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
                     NPVariant *result);
bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName,
                     const NPVariant *value);
bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName);
bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName);
bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier,
                   uint32_t *count);
bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args,
                   uint32_t argCount, NPVariant *result);

/*
    NPN_SetException may be called to trigger a script exception upon
    return from entry points into NPObjects.  Typical usage:

    NPN_SetException (npobj, message);
*/
void NPN_SetException(NPObject *npobj, const NPUTF8 *message);

#ifdef __cplusplus
}
#endif

#endif


================================================
FILE: plugin/nptypes.h
================================================
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * mozilla.org.
 * Portions created by the Initial Developer are Copyright (C) 2004
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Johnny Stenback <jst@mozilla.org> (Original author)
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 * Header file for ensuring that C99 types ([u]int32_t and bool) and
 * true/false macros are available.
 */

#if defined(WIN32) || defined(OS2)
  /*
   * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool
   * is predefined tho, both in C and C++.
   */
  typedef short int16_t;
  typedef unsigned short uint16_t;
  typedef int int32_t;
  typedef unsigned int uint32_t;
#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
  /*
   * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
   * but not bool for C.
   */
  #include <inttypes.h>

  #ifndef __cplusplus
    typedef int bool;
    #define true   1
    #define false  0
  #endif
#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
  /*
   * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
   * u_int32_t.
   */
  #include <sys/types.h>

  /*
   * BSD/OS ships no header that defines uint32_t, nor bool (for C)
   */
  #if defined(bsdi)
  typedef u_int32_t uint32_t;

  #if !defined(__cplusplus)
    typedef int bool;
    #define true   1
    #define false  0
  #endif
  #else
  /*
   * FreeBSD and OpenBSD define uint32_t and bool.
   */
    #include <inttypes.h>
    #include <stdbool.h>
  #endif
#elif defined(BEOS)
  #include <inttypes.h>
#else
  /*
   * For those that ship a standard C99 stdint.h header file, include
   * it. Can't do the same for stdbool.h tho, since some systems ship
   * with a stdbool.h file that doesn't compile!
   */
  #include <stdint.h>

  #ifndef __cplusplus
    #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
      #include <stdbool.h>
    #else
      /*
       * GCC 2.91 can't deal with a typedef for bool, but a #define
       * works.
       */
      #define bool int
      #define true   1
      #define false  0
    #endif
  #endif
#endif


================================================
FILE: plugin/plugin_base.cc
================================================
#include "plugin_base.h"

PluginBase::PluginBase(void) {
}

PluginBase::~PluginBase(void) {
}

NPError PluginBase::Init(NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) {
    npp_ = instance;
    return NPERR_NO_ERROR;
}

NPError PluginBase::UnInit(NPSavedData** save) {
    return NPERR_NO_ERROR;
}

NPError PluginBase::SetWindow(NPWindow* window) {
    native_window_ = (NativeWindow)window->window;
    return NPERR_NO_ERROR;
}

NPError PluginBase::NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) {
    return NPERR_NO_ERROR;
}

NPError PluginBase::DestroyStream(NPStream* stream, NPReason reason) {
    return NPERR_NO_ERROR;
}

int32_t PluginBase::WriteReady(NPStream* stream) {
    return 0;
}

int32_t PluginBase::Write(NPStream* stream, int32_t offset, int32_t len, void* buffer) {
    return 0;
}

void PluginBase::StreamAsFile(NPStream* stream, const char* fname) {
}

void PluginBase::Print(NPPrint* platformPrint) {
}

int16_t PluginBase::HandleEvent(void* event) {
    return 0;
}

void PluginBase::URLNotify(const char* url, NPReason reason, void* notifyData) {
}

NPError PluginBase::GetValue(NPPVariable variable, void *value) {
    return NPERR_NO_ERROR;
}

NPError PluginBase::SetValue(NPNVariable variable, void *value) {
    return NPERR_NO_ERROR;
}


================================================
FILE: plugin/plugin_base.h
================================================
#ifndef PLUGIN_BASE_H_
#define PLUGIN_BASE_H_

#include "npapi.h"

#ifdef _WINDOWS
typedef HWND NativeWindow;
#elif defined MAC
#include "npapi.h"
typedef NP_CGContext* NativeWindow;
#endif


class PluginBase {
public:
    PluginBase(void);
    virtual ~PluginBase(void);

    virtual NPError Init(NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
    virtual NPError UnInit(NPSavedData** save);
    virtual NPError SetWindow(NPWindow* window);
    virtual NPError NewStream(NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
    virtual NPError DestroyStream(NPStream* stream, NPReason reason);
    virtual int32_t WriteReady(NPStream* stream);
    virtual int32_t Write(NPStream* stream, int32_t offset, int32_t len, void* buffer);
    virtual void StreamAsFile(NPStream* stream, const char* fname);
    virtual void Print(NPPrint* platformPrint);
    virtual int16_t HandleEvent(void* event);
    virtual void URLNotify(const char* url, NPReason reason, void* notifyData);
    virtual NPError GetValue(NPPVariable variable, void *value);
    virtual NPError SetValue(NPNVariable variable, void *value);

    NPP get_npp() const { return npp_; }
    void set_npp(NPP npp) { npp_ = npp; }

    NativeWindow get_native_window() const { return native_window_; }
    void set_native_window(NativeWindow nw) { native_window_ = nw; }

protected:
    NPP npp_;
    NativeWindow native_window_;
};

#endif    // PLUGIN_BASE_H_


================================================
FILE: plugin/plugin_factory.cc
================================================
#include "plugin_factory.h"
#include "chrome_fiddler_plugin.h"

PluginFactory::PluginTypeMap PluginFactory::plugin_type_map_;

void PluginFactory::Init() {
    PluginTypeItem item;
    item.mime_type = "application/x-chromefiddler";
    item.constructor = &ChromeFiddlerPlugin::CreateObject;
    plugin_type_map_.insert(PluginTypeMap::value_type(item.mime_type, item));
}

PluginBase* PluginFactory::NewPlugin(NPMIMEType pluginType) {
    PluginBase* plugin = NULL;
    PluginTypeMap::iterator iter = plugin_type_map_.find(pluginType);
    if (iter != plugin_type_map_.end())
        plugin = iter->second.constructor();

    return plugin;
}


================================================
FILE: plugin/plugin_factory.h
================================================
#ifndef PLUGIN_FACTORY_H_
#define PLUGIN_FACTORY_H_

#include <map>
#include <string>

#include "plugin_base.h"

typedef PluginBase* (*ConstructorPtr)();

class PluginFactory {
private:
    PluginFactory(void);
    ~PluginFactory(void);

public:
    static void Init();
    static PluginBase* NewPlugin(NPMIMEType pluginType);

public:
    struct PluginTypeItem {
        std::string mime_type;
        ConstructorPtr constructor;
    };

    typedef std::map<std::string, PluginTypeItem> PluginTypeMap;

private:
    static PluginTypeMap plugin_type_map_;
};

#endif


================================================
FILE: plugin/script_object_base.cc
================================================
#include "script_object_base.h"
#include "utils.h"

bool ScriptObjectBase::HasMethod(NPIdentifier name) {
    bool ret = false;
    utils::IdentifiertoString method_name(name);
    if (method_name.identifier_name()) {
        FunctionMap::iterator iter = function_map_.find((const char*)method_name);
        ret = iter != function_map_.end();
    }
    return ret;
}

bool ScriptObjectBase::Invoke(NPIdentifier name,const NPVariant *args, uint32_t argCount,NPVariant *result) {
    bool ret = false;
    utils::IdentifiertoString method_name(name);
    if (method_name.identifier_name()) {
        FunctionMap::iterator iter = function_map_.find((const char*)method_name);
        if (iter != function_map_.end())
            ret = (this->*(iter->second.function_pointer))(args, argCount, result);
    }
    return ret;
}

bool ScriptObjectBase::HasProperty(NPIdentifier name) {
    bool ret = false;
    utils::IdentifiertoString property_name(name);
    if (property_name.identifier_name()) {
        PropertyMap::iterator iter = property_map_.find((const char*)property_name);
        ret = iter != property_map_.end();
    }
    return ret;
}

bool ScriptObjectBase::GetProperty(NPIdentifier name, NPVariant *result) {
    bool ret = false;
    utils::IdentifiertoString property_name(name);
    if (property_name.identifier_name()) {
        PropertyMap::iterator iter = property_map_.find((const char*)property_name);
        if (iter != property_map_.end()) {
            *result = iter->second.property_value;
            ret = true;
        }
    }
    return ret;
}

bool ScriptObjectBase::SetProperty(NPIdentifier name, const NPVariant *value) {
    bool ret = false;
    utils::IdentifiertoString property_name(name);
    if (property_name.identifier_name()) {
        PropertyMap::iterator iter = property_map_.find((const char*)property_name);
        if (iter != property_map_.end()) {
            iter->second.property_value = *value;
            ret = true;
        }
    }
    return ret;
}
bool ScriptObjectBase::RemoveProperty(NPIdentifier name) {
    bool ret = false;
    utils::IdentifiertoString property_name(name);
    if (property_name.identifier_name()) {
        PropertyMap::iterator iter = property_map_.find((const char*)property_name);
        if (iter != property_map_.end()) {
            property_map_.erase(iter);
            ret = true;
        }
    }
    return ret;
}

void ScriptObjectBase::AddProperty(PropertyItem& item) {
    PropertyMap::iterator iter = property_map_.find(item.property_name);
    if (iter != property_map_.end())
        return;

    property_map_.insert(PropertyMap::value_type(item.property_name, item));
}

void ScriptObjectBase::AddFunction(FunctionItem& item) {
    FunctionMap::iterator iter = function_map_.find(item.function_name);
    if (iter != function_map_.end())
        return;

    function_map_.insert(FunctionMap::value_type(item.function_name, item));
}


================================================
FILE: plugin/script_object_base.h
================================================
#ifndef SCRIPT_OBJECT_BASE_H_
#define SCRIPT_OBJECT_BASE_H_

#include <map>
#include <string>

#include "npapi.h"
#include "npruntime.h"
#include "plugin_base.h"

class ScriptObjectBase : public NPObject {
public:
    ScriptObjectBase(void) {}
    virtual ~ScriptObjectBase(void) {}

    typedef bool (ScriptObjectBase::*InvokePtr)(const NPVariant *args, uint32_t argCount, NPVariant *result);

    struct FunctionItem {
        std::string function_name;
        InvokePtr function_pointer;
    };

    struct PropertyItem {
        std::string property_name;
        NPVariant property_value;
    };

    virtual void Deallocate() = 0;
    virtual void Invalidate() = 0;
    virtual bool HasMethod(NPIdentifier name);
    virtual bool Invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result);
    virtual bool InvokeDefault(const NPVariant *args, uint32_t argCount, NPVariant *result) { return false; }
    virtual bool HasProperty(NPIdentifier name);
    virtual bool GetProperty(NPIdentifier name, NPVariant *result);
    virtual bool SetProperty(NPIdentifier name, const NPVariant *value);
    virtual bool RemoveProperty(NPIdentifier name);
    virtual bool Enumerate(NPIdentifier **value, uint32_t *count) { return false; }
    virtual bool Construct(const NPVariant *args, uint32_t argCount, NPVariant *result) = 0;
    virtual void InitHandler() {}

protected:
    void AddProperty(PropertyItem& item);
    void AddFunction(FunctionItem& item);

    void set_plugin(PluginBase* plug) { plugin_ = plug; }
    PluginBase* get_plugin() { return plugin_; }

private:
    typedef std::map<std::string, FunctionItem> FunctionMap;
    typedef std::map<std::string, PropertyItem> PropertyMap;
    FunctionMap function_map_;
    PropertyMap property_map_;
    PluginBase* plugin_;

};

#define ON_INVOKEHELPER(_funPtr) \
    static_cast<bool (ScriptObjectBase::*)(const NPVariant *,uint32_t , NPVariant *)>(_funPtr)
#endif


================================================
FILE: plugin/script_object_factory.cc
================================================
#include "script_object_factory.h"

NPClass ScriptObjectFactory::npclass_ = {
    NP_CLASS_STRUCT_VERSION,
    ScriptObjectFactory::Allocate,
    ScriptObjectFactory::Deallocate,
    ScriptObjectFactory::Invalidate,
    ScriptObjectFactory::HasMethod,
    ScriptObjectFactory::Invoke,
    ScriptObjectFactory::InvokeDefault,
    ScriptObjectFactory::HasProperty,
    ScriptObjectFactory::GetProperty,
    ScriptObjectFactory::SetProperty,
    ScriptObjectFactory::RemoveProperty,
    ScriptObjectFactory::Enumerate,
    ScriptObjectFactory::Construct
};

ScriptObjectFactory::ScriptObjectFactory(void) {
}

ScriptObjectFactory::~ScriptObjectFactory(void) {
}

ScriptObjectBase* ScriptObjectFactory::CreateObject(NPP npp, NPAllocateFunctionPtr allocate) {
    npclass_.allocate = allocate;
    ScriptObjectBase* object = (ScriptObjectBase*)NPN_CreateObject(npp, &npclass_);
    if (object) {
        object->InitHandler();
    }
    return object;
}

NPObject* ScriptObjectFactory::Allocate(NPP npp, NPClass *aClass) {
    return NULL;
}

void ScriptObjectFactory::Deallocate(NPObject *npobj) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    pObject->Deallocate();
}

void ScriptObjectFactory::Invalidate(NPObject *npobj) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    pObject->Invalidate();
}

bool ScriptObjectFactory::HasMethod(NPObject *npobj, NPIdentifier name) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->HasMethod(name);
}

bool ScriptObjectFactory::Invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->Invoke(name, args, argCount, result);
}

bool ScriptObjectFactory::InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->InvokeDefault(args, argCount, result);
}

bool ScriptObjectFactory::HasProperty(NPObject *npobj, NPIdentifier name) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->HasProperty(name);
}

bool ScriptObjectFactory::GetProperty(NPObject *npobj, NPIdentifier name, NPVariant *result) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->GetProperty(name, result);
}

bool ScriptObjectFactory::SetProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->SetProperty(name, value);
}

bool ScriptObjectFactory::RemoveProperty(NPObject *npobj, NPIdentifier name) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->RemoveProperty(name);
}

bool ScriptObjectFactory::Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->Enumerate(value, count);
}

bool ScriptObjectFactory::Construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) {
    ScriptObjectBase* pObject = (ScriptObjectBase*)npobj;
    return pObject->Construct(args, argCount, result);
}

================================================
FILE: plugin/script_object_factory.h
================================================
#ifndef SCRIPT_OBJECT_FACTORY_H_
#define SCRIPT_OBJECT_FACTORY_H_

#include "script_object_base.h"

class ScriptObjectFactory {
public:
    ScriptObjectFactory(void);
    ~ScriptObjectFactory(void);

    static ScriptObjectBase* CreateObject(NPP npp, NPAllocateFunctionPtr allocate);

private:
    static NPObject* Allocate(NPP npp, NPClass *aClass);
    static void Deallocate(NPObject *npobj);
    static void Invalidate(NPObject *npobj);
    static bool HasMethod(NPObject *npobj, NPIdentifier name);
    static bool Invoke(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result);
    static bool InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result);
    static bool HasProperty(NPObject *npobj, NPIdentifier name);
    static bool GetProperty(NPObject *npobj, NPIdentifier name, NPVariant *result);
    static bool SetProperty(NPObject *npobj, NPIdentifier name, const NPVariant *value);
    static bool RemoveProperty(NPObject *npobj, NPIdentifier name);
    static bool Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count);
    static bool Construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result);

private:
    static NPClass npclass_;
};

#endif    // SCRIPT_OBJECT_FACTORY_H_

================================================
FILE: plugin/utils.h
================================================
#ifndef UTIL_H_
#define UTIL_H_

#ifdef _WINDOWS
#include <windows.h>
#endif

#include "npfunctions.h"

namespace utils {

class IdentifiertoString {
public:
    explicit IdentifiertoString(NPIdentifier identifier) : identifier_name_(NULL) {
        identifier_name_ = NPN_UTF8FromIdentifier(identifier);
    }
    const char* identifier_name() const { return identifier_name_; }
    operator const char*() const { return identifier_name_; }
    ~IdentifiertoString() { if (identifier_name_) NPN_MemFree(identifier_name_); }

private:
    // Disable evil constructors.
    IdentifiertoString();
    IdentifiertoString(const IdentifiertoString&);

    char* identifier_name_;
};

#ifdef _WINDOWS
class Utf8ToUnicode {
public:
    explicit Utf8ToUnicode(const char* utf8data, unsigned int datalen = -1) : buffer_(NULL) {
        int size = MultiByteToWideChar(CP_UTF8, 0, utf8data, datalen, 0, 0);
        if (size > 0)
            buffer_ = new WCHAR[size + 1];
        if (buffer_) {
            MultiByteToWideChar(CP_UTF8, 0, utf8data, datalen, buffer_, size);
            buffer_[size] = 0;
        }
    }
    operator WCHAR*() const { return buffer_; }
    WCHAR** operator &() { return &buffer_; }
    ~Utf8ToUnicode() { if (buffer_) delete[] buffer_; }

private:
    Utf8ToUnicode();
    Utf8ToUnicode(const Utf8ToUnicode&);
    WCHAR* buffer_;
};
#endif

}

#endif


================================================
FILE: src/bin/chrome_fiddler.plugin/Contents/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>chrome_fiddler</string>
	<key>CFBundleGetInfoString</key>
	<string>420+, Copyright 2006-2009 Apple Inc.</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>chrome.chrome_fiddler</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>BRPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>CFPlugInDynamicRegisterFunction</key>
	<string></string>
	<key>CFPlugInDynamicRegistration</key>
	<string>NO</string>
	<key>CFPlugInFactories</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<string>MyFactoryFunction</string>
	</dict>
	<key>CFPlugInTypes</key>
	<dict>
		<key>00000000-0000-0000-0000-000000000000</key>
		<array>
			<string>00000000-0000-0000-0000-000000000000</string>
		</array>
	</dict>
	<key>CFPlugInUnloadFunction</key>
	<string></string>
	<key>WebPluginDescription</key>
	<string>Chrome Fiddler Extension Plugin</string>
	<key>WebPluginMIMETypes</key>
	<dict>
		<key>application/x-chromefiddler</key>
		<dict>
			<key>WebPluginExtensions</key>
			<array>
				<string>chrome_fiddler</string>
			</array>
			<key>WebPluginTypeDescription</key>
			<string>Chrome Fiddler Extension Plugin</string>
		</dict>
	</dict>
	<key>WebPluginName</key>
	<string>Chrome Fiddler Extension Plugin</string>
</dict>
</plist>


================================================
FILE: src/css/lib/bootstrap.css
================================================
/*!
 * Bootstrap v2.3.2
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat.
 */

.clearfix {
  *zoom: 1;
}

.clearfix:before,
.clearfix:after {
  display: table;
  line-height: 0;
  content: "";
}

.clearfix:after {
  clear: both;
}

.hide-text {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}

.input-block-level {
  display: block;
  width: 100%;
  min-height: 30px;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}

audio,
canvas,
video {
  display: inline-block;
  *display: inline;
  *zoom: 1;
}

audio:not([controls]) {
  display: none;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
}

a:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

a:hover,
a:active {
  outline: 0;
}

sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

img {
  width: auto\9;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}

#map_canvas img,
.google-maps img {
  max-width: none;
}

button,
input,
select,
textarea {
  margin: 0;
  font-size: 100%;
  vertical-align: middle;
}

button,
input {
  *overflow: visible;
  line-height: normal;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
  padding: 0;
  border: 0;
}

button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
}

label,
select,
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
input[type="radio"],
input[type="checkbox"] {
  cursor: pointer;
}

input[type="search"] {
  -webkit-box-sizing: content-box;
     -moz-box-sizing: content-box;
          box-sizing: content-box;
  -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

textarea {
  overflow: auto;
  vertical-align: top;
}

@media print {
  * {
    color: #000 !important;
    text-shadow: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  a,
  a:visited {
    text-decoration: underline;
  }
  a[href]:after {
    content: " (" attr(href) ")";
  }
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
  .ir a:after,
  a[href^="javascript:"]:after,
  a[href^="#"]:after {
    content: "";
  }
  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  thead {
    display: table-header-group;
  }
  tr,
  img {
    page-break-inside: avoid;
  }
  img {
    max-width: 100% !important;
  }
  @page  {
    margin: 0.5cm;
  }
  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }
  h2,
  h3 {
    page-break-after: avoid;
  }
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
  background-color: #ffffff;
}

a {
  color: #0088cc;
  text-decoration: none;
}

a:hover,
a:focus {
  color: #005580;
  text-decoration: underline;
}

.img-rounded {
  -webkit-border-radius: 6px;
     -moz-border-radius: 6px;
          border-radius: 6px;
}

.img-polaroid {
  padding: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
     -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.img-circle {
  -webkit-border-radius: 500px;
     -moz-border-radius: 500px;
          border-radius: 500px;
}

.row {
  margin-left: -20px;
  *zoom: 1;
}

.row:before,
.row:after {
  display: table;
  line-height: 0;
  content: "";
}

.row:after {
  clear: both;
}

[class*="span"] {
  float: left;
  min-height: 1px;
  margin-left: 20px;
}

.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
  width: 940px;
}

.span12 {
  width: 940px;
}

.span11 {
  width: 860px;
}

.span10 {
  width: 780px;
}

.span9 {
  width: 700px;
}

.span8 {
  width: 620px;
}

.span7 {
  width: 540px;
}

.span6 {
  width: 460px;
}

.span5 {
  width: 380px;
}

.span4 {
  width: 300px;
}

.span3 {
  width: 220px;
}

.span2 {
  width: 140px;
}

.span1 {
  width: 60px;
}

.offset12 {
  margin-left: 980px;
}

.offset11 {
  margin-left: 900px;
}

.offset10 {
  margin-left: 820px;
}

.offset9 {
  margin-left: 740px;
}

.offset8 {
  margin-left: 660px;
}

.offset7 {
  margin-left: 580px;
}

.offset6 {
  margin-left: 500px;
}

.offset5 {
  margin-left: 420px;
}

.offset4 {
  margin-left: 340px;
}

.offset3 {
  margin-left: 260px;
}

.offset2 {
  margin-left: 180px;
}

.offset1 {
  margin-left: 100px;
}

.row-fluid {
  width: 100%;
  *zoom: 1;
}

.row-fluid:before,
.row-fluid:after {
  display: table;
  line-height: 0;
  content: "";
}

.row-fluid:after {
  clear: both;
}

.row-fluid [class*="span"] {
  display: block;
  float: left;
  width: 100%;
  min-height: 30px;
  margin-left: 2.127659574468085%;
  *margin-left: 2.074468085106383%;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

.row-fluid [class*="span"]:first-child {
  margin-left: 0;
}

.row-fluid .controls-row [class*="span"] + [class*="span"] {
  margin-left: 2.127659574468085%;
}

.row-fluid .span12 {
  width: 100%;
  *width: 99.94680851063829%;
}

.row-fluid .span11 {
  width: 91.48936170212765%;
  *width: 91.43617021276594%;
}

.row-fluid .span10 {
  width: 82.97872340425532%;
  *width: 82.92553191489361%;
}

.row-fluid .span9 {
  width: 74.46808510638297%;
  *width: 74.41489361702126%;
}

.row-fluid .span8 {
  width: 65.95744680851064%;
  *width: 65.90425531914893%;
}

.row-fluid .span7 {
  width: 57.44680851063829%;
  *width: 57.39361702127659%;
}

.row-fluid .span6 {
  width: 48.93617021276595%;
  *width: 48.88297872340425%;
}

.row-fluid .span5 {
  width: 40.42553191489362%;
  *width: 40.37234042553192%;
}

.row-fluid .span4 {
  width: 31.914893617021278%;
  *width: 31.861702127659576%;
}

.row-fluid .span3 {
  width: 23.404255319148934%;
  *width: 23.351063829787233%;
}

.row-fluid .span2 {
  width: 14.893617021276595%;
  *width: 14.840425531914894%;
}

.row-fluid .span1 {
  width: 6.382978723404255%;
  *width: 6.329787234042553%;
}

.row-fluid .offset12 {
  margin-left: 104.25531914893617%;
  *margin-left: 104.14893617021275%;
}

.row-fluid .offset12:first-child {
  margin-left: 102.12765957446808%;
  *margin-left: 102.02127659574467%;
}

.row-fluid .offset11 {
  margin-left: 95.74468085106382%;
  *margin-left: 95.6382978723404%;
}

.row-fluid .offset11:first-child {
  margin-left: 93.61702127659574%;
  *margin-left: 93.51063829787232%;
}

.row-fluid .offset10 {
  margin-left: 87.23404255319149%;
  *margin-left: 87.12765957446807%;
}

.row-fluid .offset10:first-child {
  margin-left: 85.1063829787234%;
  *margin-left: 84.99999999999999%;
}

.row-fluid .offset9 {
  margin-left: 78.72340425531914%;
  *margin-left: 78.61702127659572%;
}

.row-fluid .offset9:first-child {
  margin-left: 76.59574468085106%;
  *margin-left: 76.48936170212764%;
}

.row-fluid .offset8 {
  margin-left: 70.2127659574468%;
  *margin-left: 70.10638297872339%;
}

.row-fluid .offset8:first-child {
  margin-left: 68.08510638297872%;
  *margin-left: 67.9787234042553%;
}

.row-fluid .offset7 {
  margin-left: 61.70212765957446%;
  *margin-left: 61.59574468085106%;
}

.row-fluid .offset7:first-child {
  margin-left: 59.574468085106375%;
  *margin-left: 59.46808510638297%;
}

.row-fluid .offset6 {
  margin-left: 53.191489361702125%;
  *margin-left: 53.085106382978715%;
}

.row-fluid .offset6:first-child {
  margin-left: 51.063829787234035%;
  *margin-left: 50.95744680851063%;
}

.row-fluid .offset5 {
  margin-left: 44.68085106382979%;
  *margin-left: 44.57446808510638%;
}

.row-fluid .offset5:first-child {
  margin-left: 42.5531914893617%;
  *margin-left: 42.4468085106383%;
}

.row-fluid .offset4 {
  margin-left: 36.170212765957444%;
  *margin-left: 36.06382978723405%;
}

.row-fluid .offset4:first-child {
  margin-left: 34.04255319148936%;
  *margin-left: 33.93617021276596%;
}

.row-fluid .offset3 {
  margin-left: 27.659574468085104%;
  *margin-left: 27.5531914893617%;
}

.row-fluid .offset3:first-child {
  margin-left: 25.53191489361702%;
  *margin-left: 25.425531914893618%;
}

.row-fluid .offset2 {
  margin-left: 19.148936170212764%;
  *margin-left: 19.04255319148936%;
}

.row-fluid .offset2:first-child {
  margin-left: 17.02127659574468%;
  *margin-left: 16.914893617021278%;
}

.row-fluid .offset1 {
  margin-left: 10.638297872340425%;
  *margin-left: 10.53191489361702%;
}

.row-fluid .offset1:first-child {
  margin-left: 8.51063829787234%;
  *margin-left: 8.404255319148938%;
}

[class*="span"].hide,
.row-fluid [class*="span"].hide {
  display: none;
}

[class*="span"].pull-right,
.row-fluid [class*="span"].pull-right {
  float: right;
}

.container {
  margin-right: auto;
  margin-left: auto;
  *zoom: 1;
}

.container:before,
.container:after {
  display: table;
  line-height: 0;
  content: "";
}

.container:after {
  clear: both;
}

.container-fluid {
  padding-right: 20px;
  padding-left: 20px;
  *zoom: 1;
}

.container-fluid:before,
.container-fluid:after {
  display: table;
  line-height: 0;
  content: "";
}

.container-fluid:after {
  clear: both;
}

p {
  margin: 0 0 10px;
}

.lead {
  margin-bottom: 20px;
  font-size: 21px;
  font-weight: 200;
  line-height: 30px;
}

small {
  font-size: 85%;
}

strong {
  font-weight: bold;
}

em {
  font-style: italic;
}

cite {
  font-style: normal;
}

.muted {
  color: #999999;
}

a.muted:hover,
a.muted:focus {
  color: #808080;
}

.text-warning {
  color: #c09853;
}

a.text-warning:hover,
a.text-warning:focus {
  color: #a47e3c;
}

.text-error {
  color: #b94a48;
}

a.text-error:hover,
a.text-error:focus {
  color: #953b39;
}

.text-info {
  color: #3a87ad;
}

a.text-info:hover,
a.text-info:focus {
  color: #2d6987;
}

.text-success {
  color: #468847;
}

a.text-success:hover,
a.text-success:focus {
  color: #356635;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 10px 0;
  font-family: inherit;
  font-weight: bold;
  line-height: 20px;
  color: inherit;
  text-rendering: optimizelegibility;
}

h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
  font-weight: normal;
  line-height: 1;
  color: #999999;
}

h1,
h2,
h3 {
  line-height: 40px;
}

h1 {
  font-size: 38.5px;
}

h2 {
  font-size: 31.5px;
}

h3 {
  font-size: 24.5px;
}

h4 {
  font-size: 17.5px;
}

h5 {
  font-size: 14px;
}

h6 {
  font-size: 11.9px;
}

h1 small {
  font-size: 24.5px;
}

h2 small {
  font-size: 17.5px;
}

h3 small {
  font-size: 14px;
}

h4 small {
  font-size: 14px;
}

.page-header {
  padding-bottom: 9px;
  margin: 20px 0 30px;
  border-bottom: 1px solid #eeeeee;
}

ul,
ol {
  padding: 0;
  margin: 0 0 10px 25px;
}

ul ul,
ul ol,
ol ol,
ol ul {
  margin-bottom: 0;
}

li {
  line-height: 20px;
}

ul.unstyled,
ol.unstyled {
  margin-left: 0;
  list-style: none;
}

ul.inline,
ol.inline {
  margin-left: 0;
  list-style: none;
}

ul.inline > li,
ol.inline > li {
  display: inline-block;
  *display: inline;
  padding-right: 5px;
  padding-left: 5px;
  *zoom: 1;
}

dl {
  margin-bottom: 20px;
}

dt,
dd {
  line-height: 20px;
}

dt {
  font-weight: bold;
}

dd {
  margin-left: 10px;
}

.dl-horizontal {
  *zoom: 1;
}

.dl-horizontal:before,
.dl-horizontal:after {
  display: table;
  line-height: 0;
  content: "";
}

.dl-horizontal:after {
  clear: both;
}

.dl-horizontal dt {
  float: left;
  width: 160px;
  overflow: hidden;
  clear: left;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-horizontal dd {
  margin-left: 180px;
}

hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #ffffff;
}

abbr[title],
abbr[data-original-title] {
  cursor: help;
  border-bottom: 1px dotted #999999;
}

abbr.initialism {
  font-size: 90%;
  text-transform: uppercase;
}

blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 20px;
  border-left: 5px solid #eeeeee;
}

blockquote p {
  margin-bottom: 0;
  font-size: 17.5px;
  font-weight: 300;
  line-height: 1.25;
}

blockquote small {
  display: block;
  line-height: 20px;
  color: #999999;
}

blockquote small:before {
  content: '\2014 \00A0';
}

blockquote.pull-right {
  float: right;
  padding-right: 15px;
  padding-left: 0;
  border-right: 5px solid #eeeeee;
  border-left: 0;
}

blockquote.pull-right p,
blockquote.pull-right small {
  text-align: right;
}

blockquote.pull-right small:before {
  content: '';
}

blockquote.pull-right small:after {
  content: '\00A0 \2014';
}

q:before,
q:after,
blockquote:before,
blockquote:after {
  content: "";
}

address {
  display: block;
  margin-bottom: 20px;
  font-style: normal;
  line-height: 20px;
}

code,
pre {
  padding: 0 3px 2px;
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #333333;
  -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
          border-radius: 3px;
}

code {
  padding: 2px 4px;
  color: #d14;
  white-space: nowrap;
  background-color: #f7f7f9;
  border: 1px solid #e1e1e8;
}

pre {
  display: block;
  padding: 9.5px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 20px;
  word-break: break-all;
  word-wrap: break-word;
  white-space: pre;
  white-space: pre-wrap;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.15);
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
}

pre.prettyprint {
  margin-bottom: 20px;
}

pre code {
  padding: 0;
  color: inherit;
  white-space: pre;
  white-space: pre-wrap;
  background-color: transparent;
  border: 0;
}

.pre-scrollable {
  max-height: 340px;
  overflow-y: scroll;
}

form {
  margin: 0 0 20px;
}

fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 20px;
  font-size: 21px;
  line-height: 40px;
  color: #333333;
  border: 0;
  border-bottom: 1px solid #e5e5e5;
}

legend small {
  font-size: 15px;
  color: #999999;
}

label,
input,
button,
select,
textarea {
  font-size: 14px;
  font-weight: normal;
  line-height: 20px;
}

input,
button,
select,
textarea {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

label {
  display: block;
  margin-bottom: 5px;
}

select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
  display: inline-block;
  height: 20px;
  padding: 4px 6px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 20px;
  color: #555555;
  vertical-align: middle;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
}

input,
textarea,
.uneditable-input {
  width: 206px;
}

textarea {
  height: auto;
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
  background-color: #ffffff;
  border: 1px solid #cccccc;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
     -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
       -o-transition: border linear 0.2s, box-shadow linear 0.2s;
          transition: border linear 0.2s, box-shadow linear 0.2s;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
  border-color: rgba(82, 168, 236, 0.8);
  outline: 0;
  outline: thin dotted \9;
  /* IE6-9 */

  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}

input[type="radio"],
input[type="checkbox"] {
  margin: 4px 0 0;
  margin-top: 1px \9;
  *margin-top: 0;
  line-height: normal;
}

input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
  width: auto;
}

select,
input[type="file"] {
  height: 30px;
  /* In IE7, the height of the select element cannot be changed by height, only font-size */

  *margin-top: 4px;
  /* For IE7, add top margin to align select with labels */

  line-height: 30px;
}

select {
  width: 220px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
}

select[multiple],
select[size] {
  height: auto;
}

select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

.uneditable-input,
.uneditable-textarea {
  color: #999999;
  cursor: not-allowed;
  background-color: #fcfcfc;
  border-color: #cccccc;
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
     -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
}

.uneditable-input {
  overflow: hidden;
  white-space: nowrap;
}

.uneditable-textarea {
  width: auto;
  height: auto;
}

input:-moz-placeholder,
textarea:-moz-placeholder {
  color: #999999;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #999999;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #999999;
}

.radio,
.checkbox {
  min-height: 20px;
  padding-left: 20px;
}

.radio input[type="radio"],
.checkbox input[type="checkbox"] {
  float: left;
  margin-left: -20px;
}

.controls > .radio:first-child,
.controls > .checkbox:first-child {
  padding-top: 5px;
}

.radio.inline,
.checkbox.inline {
  display: inline-block;
  padding-top: 5px;
  margin-bottom: 0;
  vertical-align: middle;
}

.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
  margin-left: 10px;
}

.input-mini {
  width: 60px;
}

.input-small {
  width: 90px;
}

.input-medium {
  width: 150px;
}

.input-large {
  width: 210px;
}

.input-xlarge {
  width: 270px;
}

.input-xxlarge {
  width: 530px;
}

input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"] {
  float: none;
  margin-left: 0;
}

.input-append input[class*="span"],
.input-append .uneditable-input[class*="span"],
.input-prepend input[class*="span"],
.input-prepend .uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"],
.row-fluid .input-prepend [class*="span"],
.row-fluid .input-append [class*="span"] {
  display: inline-block;
}

input,
textarea,
.uneditable-input {
  margin-left: 0;
}

.controls-row [class*="span"] + [class*="span"] {
  margin-left: 20px;
}

input.span12,
textarea.span12,
.uneditable-input.span12 {
  width: 926px;
}

input.span11,
textarea.span11,
.uneditable-input.span11 {
  width: 846px;
}

input.span10,
textarea.span10,
.uneditable-input.span10 {
  width: 766px;
}

input.span9,
textarea.span9,
.uneditable-input.span9 {
  width: 686px;
}

input.span8,
textarea.span8,
.uneditable-input.span8 {
  width: 606px;
}

input.span7,
textarea.span7,
.uneditable-input.span7 {
  width: 526px;
}

input.span6,
textarea.span6,
.uneditable-input.span6 {
  width: 446px;
}

input.span5,
textarea.span5,
.uneditable-input.span5 {
  width: 366px;
}

input.span4,
textarea.span4,
.uneditable-input.span4 {
  width: 286px;
}

input.span3,
textarea.span3,
.uneditable-input.span3 {
  width: 206px;
}

input.span2,
textarea.span2,
.uneditable-input.span2 {
  width: 126px;
}

input.span1,
textarea.span1,
.uneditable-input.span1 {
  width: 46px;
}

.controls-row {
  *zoom: 1;
}

.controls-row:before,
.controls-row:after {
  display: table;
  line-height: 0;
  content: "";
}

.controls-row:after {
  clear: both;
}

.controls-row [class*="span"],
.row-fluid .controls-row [class*="span"] {
  float: left;
}

.controls-row .checkbox[class*="span"],
.controls-row .radio[class*="span"] {
  padding-top: 5px;
}

input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
  cursor: not-allowed;
  background-color: #eeeeee;
}

input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
  background-color: transparent;
}

.control-group.warning .control-label,
.control-group.warning .help-block,
.control-group.warning .help-inline {
  color: #c09853;
}

.control-group.warning .checkbox,
.control-group.warning .radio,
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
  color: #c09853;
}

.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
  border-color: #c09853;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.control-group.warning input:focus,
.control-group.warning select:focus,
.control-group.warning textarea:focus {
  border-color: #a47e3c;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}

.control-group.warning .input-prepend .add-on,
.control-group.warning .input-append .add-on {
  color: #c09853;
  background-color: #fcf8e3;
  border-color: #c09853;
}

.control-group.error .control-label,
.control-group.error .help-block,
.control-group.error .help-inline {
  color: #b94a48;
}

.control-group.error .checkbox,
.control-group.error .radio,
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
  color: #b94a48;
}

.control-group.error input,
.control-group.error select,
.control-group.error textarea {
  border-color: #b94a48;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.control-group.error input:focus,
.control-group.error select:focus,
.control-group.error textarea:focus {
  border-color: #953b39;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}

.control-group.error .input-prepend .add-on,
.control-group.error .input-append .add-on {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #b94a48;
}

.control-group.success .control-label,
.control-group.success .help-block,
.control-group.success .help-inline {
  color: #468847;
}

.control-group.success .checkbox,
.control-group.success .radio,
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
  color: #468847;
}

.control-group.success input,
.control-group.success select,
.control-group.success textarea {
  border-color: #468847;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.control-group.success input:focus,
.control-group.success select:focus,
.control-group.success textarea:focus {
  border-color: #356635;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}

.control-group.success .input-prepend .add-on,
.control-group.success .input-append .add-on {
  color: #468847;
  background-color: #dff0d8;
  border-color: #468847;
}

.control-group.info .control-label,
.control-group.info .help-block,
.control-group.info .help-inline {
  color: #3a87ad;
}

.control-group.info .checkbox,
.control-group.info .radio,
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  color: #3a87ad;
}

.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  border-color: #3a87ad;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}

.control-group.info input:focus,
.control-group.info select:focus,
.control-group.info textarea:focus {
  border-color: #2d6987;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
}

.control-group.info .input-prepend .add-on,
.control-group.info .input-append .add-on {
  color: #3a87ad;
  background-color: #d9edf7;
  border-color: #3a87ad;
}

input:focus:invalid,
textarea:focus:invalid,
select:focus:invalid {
  color: #b94a48;
  border-color: #ee5f5b;
}

input:focus:invalid:focus,
textarea:focus:invalid:focus,
select:focus:invalid:focus {
  border-color: #e9322d;
  -webkit-box-shadow: 0 0 6px #f8b9b7;
     -moz-box-shadow: 0 0 6px #f8b9b7;
          box-shadow: 0 0 6px #f8b9b7;
}

.form-actions {
  padding: 19px 20px 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border-top: 1px solid #e5e5e5;
  *zoom: 1;
}

.form-actions:before,
.form-actions:after {
  display: table;
  line-height: 0;
  content: "";
}

.form-actions:after {
  clear: both;
}

.help-block,
.help-inline {
  color: #595959;
}

.help-block {
  display: block;
  margin-bottom: 10px;
}

.help-inline {
  display: inline-block;
  *display: inline;
  padding-left: 5px;
  vertical-align: middle;
  *zoom: 1;
}

.input-append,
.input-prepend {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.input-append input,
.input-prepend input,
.input-append select,
.input-prepend select,
.input-append .uneditable-input,
.input-prepend .uneditable-input,
.input-append .dropdown-menu,
.input-prepend .dropdown-menu,
.input-append .popover,
.input-prepend .popover {
  font-size: 14px;
}

.input-append input,
.input-prepend input,
.input-append select,
.input-prepend select,
.input-append .uneditable-input,
.input-prepend .uneditable-input {
  position: relative;
  margin-bottom: 0;
  *margin-left: 0;
  vertical-align: top;
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.input-append input:focus,
.input-prepend input:focus,
.input-append select:focus,
.input-prepend select:focus,
.input-append .uneditable-input:focus,
.input-prepend .uneditable-input:focus {
  z-index: 2;
}

.input-append .add-on,
.input-prepend .add-on {
  display: inline-block;
  width: auto;
  height: 20px;
  min-width: 16px;
  padding: 4px 5px;
  font-size: 14px;
  font-weight: normal;
  line-height: 20px;
  text-align: center;
  text-shadow: 0 1px 0 #ffffff;
  background-color: #eeeeee;
  border: 1px solid #ccc;
}

.input-append .add-on,
.input-prepend .add-on,
.input-append .btn,
.input-prepend .btn,
.input-append .btn-group > .dropdown-toggle,
.input-prepend .btn-group > .dropdown-toggle {
  vertical-align: top;
  -webkit-border-radius: 0;
     -moz-border-radius: 0;
          border-radius: 0;
}

.input-append .active,
.input-prepend .active {
  background-color: #a9dba9;
  border-color: #46a546;
}

.input-prepend .add-on,
.input-prepend .btn {
  margin-right: -1px;
}

.input-prepend .add-on:first-child,
.input-prepend .btn:first-child {
  -webkit-border-radius: 4px 0 0 4px;
     -moz-border-radius: 4px 0 0 4px;
          border-radius: 4px 0 0 4px;
}

.input-append input,
.input-append select,
.input-append .uneditable-input {
  -webkit-border-radius: 4px 0 0 4px;
     -moz-border-radius: 4px 0 0 4px;
          border-radius: 4px 0 0 4px;
}

.input-append input + .btn-group .btn:last-child,
.input-append select + .btn-group .btn:last-child,
.input-append .uneditable-input + .btn-group .btn:last-child {
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.input-append .add-on,
.input-append .btn,
.input-append .btn-group {
  margin-left: -1px;
}

.input-append .add-on:last-child,
.input-append .btn:last-child,
.input-append .btn-group:last-child > .dropdown-toggle {
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.input-prepend.input-append input,
.input-prepend.input-append select,
.input-prepend.input-append .uneditable-input {
  -webkit-border-radius: 0;
     -moz-border-radius: 0;
          border-radius: 0;
}

.input-prepend.input-append input + .btn-group .btn,
.input-prepend.input-append select + .btn-group .btn,
.input-prepend.input-append .uneditable-input + .btn-group .btn {
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.input-prepend.input-append .add-on:first-child,
.input-prepend.input-append .btn:first-child {
  margin-right: -1px;
  -webkit-border-radius: 4px 0 0 4px;
     -moz-border-radius: 4px 0 0 4px;
          border-radius: 4px 0 0 4px;
}

.input-prepend.input-append .add-on:last-child,
.input-prepend.input-append .btn:last-child {
  margin-left: -1px;
  -webkit-border-radius: 0 4px 4px 0;
     -moz-border-radius: 0 4px 4px 0;
          border-radius: 0 4px 4px 0;
}

.input-prepend.input-append .btn-group:first-child {
  margin-left: 0;
}

input.search-query {
  padding-right: 14px;
  padding-right: 4px \9;
  padding-left: 14px;
  padding-left: 4px \9;
  /* IE7-8 doesn't have border-radius, so don't indent the padding */

  margin-bottom: 0;
  -webkit-border-radius: 15px;
     -moz-border-radius: 15px;
          border-radius: 15px;
}

/* Allow for input prepend/append in search forms */

.form-search .input-append .search-query,
.form-search .input-prepend .search-query {
  -webkit-border-radius: 0;
     -moz-border-radius: 0;
          border-radius: 0;
}

.form-search .input-append .search-query {
  -webkit-border-radius: 14px 0 0 14px;
     -moz-border-radius: 14px 0 0 14px;
          border-radius: 14px 0 0 14px;
}

.form-search .input-append .btn {
  -webkit-border-radius: 0 14px 14px 0;
     -moz-border-radius: 0 14px 14px 0;
          border-radius: 0 14px 14px 0;
}

.form-search .input-prepend .search-query {
  -webkit-border-radius: 0 14px 14px 0;
     -moz-border-radius: 0 14px 14px 0;
          border-radius: 0 14px 14px 0;
}

.form-search .input-prepend .btn {
  -webkit-border-radius: 14px 0 0 14px;
     -moz-border-radius: 14px 0 0 14px;
          border-radius: 14px 0 0 14px;
}

.form-search input,
.form-inline input,
.form-horizontal input,
.form-search textarea,
.form-inline textarea,
.form-horizontal textarea,
.form-search select,
.form-inline select,
.form-horizontal select,
.form-search .help-inline,
.form-inline .help-inline,
.form-horizontal .help-inline,
.form-search .uneditable-input,
.form-inline .uneditable-input,
.form-horizontal .uneditable-input,
.form-search .input-prepend,
.form-inline .input-prepend,
.form-horizontal .input-prepend,
.form-search .input-append,
.form-inline .input-append,
.form-horizontal .input-append {
  display: inline-block;
  *display: inline;
  margin-bottom: 0;
  vertical-align: middle;
  *zoom: 1;
}

.form-search .hide,
.form-inline .hide,
.form-horizontal .hide {
  display: none;
}

.form-search label,
.form-inline label,
.form-search .btn-group,
.form-inline .btn-group {
  display: inline-block;
}

.form-search .input-append,
.form-inline .input-append,
.form-search .input-prepend,
.form-inline .input-prepend {
  margin-bottom: 0;
}

.form-search .radio,
.form-search .checkbox,
.form-inline .radio,
.form-inline .checkbox {
  padding-left: 0;
  margin-bottom: 0;
  vertical-align: middle;
}

.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"],
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
  float: left;
  margin-right: 3px;
  margin-left: 0;
}

.control-group {
  margin-bottom: 10px;
}

legend + .control-group {
  margin-top: 20px;
  -webkit-margin-top-collapse: separate;
}

.form-horizontal .control-group {
  margin-bottom: 20px;
  *zoom: 1;
}

.form-horizontal .control-group:before,
.form-horizontal .control-group:after {
  display: table;
  line-height: 0;
  content: "";
}

.form-horizontal .control-group:after {
  clear: both;
}

.form-horizontal .control-label {
  float: left;
  width: 160px;
  padding-top: 5px;
  text-align: right;
}

.form-horizontal .controls {
  *display: inline-block;
  *padding-left: 20px;
  margin-left: 180px;
  *margin-left: 0;
}

.form-horizontal .controls:first-child {
  *padding-left: 180px;
}

.form-horizontal .help-block {
  margin-bottom: 0;
}

.form-horizontal input + .help-block,
.form-horizontal select + .help-block,
.form-horizontal textarea + .help-block,
.form-horizontal .uneditable-input + .help-block,
.form-horizontal .input-prepend + .help-block,
.form-horizontal .input-append + .help-block {
  margin-top: 10px;
}

.form-horizontal .form-actions {
  padding-left: 180px;
}

table {
  max-width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0;
}

.table {
  width: 100%;
  margin-bottom: 20px;
}

.table th,
.table td {
  padding: 8px;
  line-height: 20px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid #dddddd;
}

.table th {
  font-weight: bold;
}

.table thead th {
  vertical-align: bottom;
}

.table caption + thead tr:first-child th,
.table caption + thead tr:first-child td,
.table colgroup + thead tr:first-child th,
.table colgroup + thead tr:first-child td,
.table thead:first-child tr:first-child th,
.table thead:first-child tr:first-child td {
  border-top: 0;
}

.table tbody + tbody {
  border-top: 2px solid #dddddd;
}

.table .table {
  background-color: #ffffff;
}

.table-condensed th,
.table-condensed td {
  padding: 4px 5px;
}

.table-bordered {
  border: 1px solid #dddddd;
  border-collapse: separate;
  *border-collapse: collapse;
  border-left: 0;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
}

.table-bordered th,
.table-bordered td {
  border-left: 1px solid #dddddd;
}

.table-bordered caption + thead tr:first-child th,
.table-bordered caption + tbody tr:first-child th,
.table-bordered caption + tbody tr:first-child td,
.table-bordered colgroup + thead tr:first-child th,
.table-bordered colgroup + tbody tr:first-child th,
.table-bordered colgroup + tbody tr:first-child td,
.table-bordered thead:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child th,
.table-bordered tbody:first-child tr:first-child td {
  border-top: 0;
}

.table-bordered thead:first-child tr:first-child > th:first-child,
.table-bordered tbody:first-child tr:first-child > td:first-child,
.table-bordered tbody:first-child tr:first-child > th:first-child {
  -webkit-border-top-left-radius: 4px;
          border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
}

.table-bordered thead:first-child tr:first-child > th:last-child,
.table-bordered tbody:first-child tr:first-child > td:last-child,
.table-bordered tbody:first-child tr:first-child > th:last-child {
  -webkit-border-top-right-radius: 4px;
          border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px;
}

.table-bordered thead:last-child tr:last-child > th:first-child,
.table-bordered tbody:last-child tr:last-child > td:first-child,
.table-bordered tbody:last-child tr:last-child > th:first-child,
.table-bordered tfoot:last-child tr:last-child > td:first-child,
.table-bordered tfoot:last-child tr:last-child > th:first-child {
  -webkit-border-bottom-left-radius: 4px;
          border-bottom-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
}

.table-bordered thead:last-child tr:last-child > th:last-child,
.table-bordered tbody:last-child tr:last-child > td:last-child,
.table-bordered tbody:last-child tr:last-child > th:last-child,
.table-bordered tfoot:last-child tr:last-child > td:last-child,
.table-bordered tfoot:last-child tr:last-child > th:last-child {
  -webkit-border-bottom-right-radius: 4px;
          border-bottom-right-radius: 4px;
  -moz-border-radius-bottomright: 4px;
}

.table-bordered tfoot + tbody:last-child tr:last-child td:first-child {
  -webkit-border-bottom-left-radius: 0;
          border-bottom-left-radius: 0;
  -moz-border-radius-bottomleft: 0;
}

.table-bordered tfoot + tbody:last-child tr:last-child td:last-child {
  -webkit-border-bottom-right-radius: 0;
          border-bottom-right-radius: 0;
  -moz-border-radius-bottomright: 0;
}

.table-bordered caption + thead tr:first-child th:first-child,
.table-bordered caption + tbody tr:first-child td:first-child,
.table-bordered colgroup + thead tr:first-child th:first-child,
.table-bordered colgroup + tbody tr:first-child td:first-child {
  -webkit-border-top-left-radius: 4px;
          border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
}

.table-bordered caption + thead tr:first-child th:last-child,
.table-bordered caption + tbody tr:first-child td:last-child,
.table-bordered colgroup + thead tr:first-child th:last-child,
.table-bordered colgroup + tbody tr:first-child td:last-child {
  -webkit-border-top-right-radius: 4px;
          border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px;
}

.table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th {
  background-color: #f9f9f9;
}

.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th {
  background-color: #f5f5f5;
}

table td[class*="span"],
table th[class*="span"],
.row-fluid table td[class*="span"],
.row-fluid table th[class*="span"] {
  display: table-cell;
  float: none;
  margin-left: 0;
}

.table td.span1,
.table th.span1 {
  float: none;
  width: 44px;
  margin-left: 0;
}

.table td.span2,
.table th.span2 {
  float: none;
  width: 124px;
  margin-left: 0;
}

.table td.span3,
.table th.span3 {
  float: none;
  width: 204px;
  margin-left: 0;
}

.table td.span4,
.table th.span4 {
  float: none;
  width: 284px;
  margin-left: 0;
}

.table td.span5,
.table th.span5 {
  float: none;
  width: 364px;
  margin-left: 0;
}

.table td.span6,
.table th.span6 {
  float: none;
  width: 444px;
  margin-left: 0;
}

.table td.span7,
.table th.span7 {
  float: none;
  width: 524px;
  margin-left: 0;
}

.table td.span8,
.table th.span8 {
  float: none;
  width: 604px;
  margin-left: 0;
}

.table td.span9,
.table th.span9 {
  float: none;
  width: 684px;
  margin-left: 0;
}

.table td.span10,
.table th.span10 {
  float: none;
  width: 764px;
  margin-left: 0;
}

.table td.span11,
.table th.span11 {
  float: none;
  width: 844px;
  margin-left: 0;
}

.table td.span12,
.table th.span12 {
  float: none;
  width: 924px;
  margin-left: 0;
}

.table tbody tr.success > td {
  background-color: #dff0d8;
}

.table tbody tr.error > td {
  background-color: #f2dede;
}

.table tbody tr.warning > td {
  background-color: #fcf8e3;
}

.table tbody tr.info > td {
  background-color: #d9edf7;
}

.table-hover tbody tr.success:hover > td {
  background-color: #d0e9c6;
}

.table-hover tbody tr.error:hover > td {
  background-color: #ebcccc;
}

.table-hover tbody tr.warning:hover > td {
  background-color: #faf2cc;
}

.table-hover tbody tr.info:hover > td {
  background-color: #c4e3f3;
}

[class^="icon-"],
[class*=" icon-"] {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  *margin-right: .3em;
  line-height: 14px;
  vertical-align: text-top;
  background-image: url("../../img/glyphicons-halflings.png");
  background-position: 14px 14px;
  background-repeat: no-repeat;
}

/* White icons with optional class, or on hover/focus/active states of certain elements */

.icon-white,
.nav-pills > .active > a > [class^="icon-"],
.nav-pills > .active > a > [class*=" icon-"],
.nav-list > .active > a > [class^="icon-"],
.nav-list > .active > a > [class*=" icon-"],
.navbar-inverse .nav > .active > a > [class^="icon-"],
.navbar-inverse .nav > .active > a > [class*=" icon-"],
.dropdown-menu > li > a:hover > [class^="icon-"],
.dropdown-menu > li > a:focus > [class^="icon-"],
.dropdown-menu > li > a:hover > [class*=" icon-"],
.dropdown-menu > li > a:focus > [class*=" icon-"],
.dropdown-menu > .active > a > [class^="icon-"],
.dropdown-menu > .active > a > [class*=" icon-"],
.dropdown-submenu:hover > a > [class^="icon-"],
.dropdown-submenu:focus > a > [class^="icon-"],
.dropdown-submenu:hover > a > [class*=" icon-"],
.dropdown-submenu:focus > a > [class*=" icon-"] {
  background-image: url("../../img/glyphicons-halflings-white.png");
}

.icon-glass {
  background-position: 0      0;
}

.icon-music {
  background-position: -24px 0;
}

.icon-search {
  background-position: -48px 0;
}

.icon-envelope {
  background-position: -72px 0;
}

.icon-heart {
  background-position: -96px 0;
}

.icon-star {
  background-position: -120px 0;
}

.icon-star-empty {
  background-position: -144px 0;
}

.icon-user {
  background-position: -168px 0;
}

.icon-film {
  background-position: -192px 0;
}

.icon-th-large {
  background-position: -216px 0;
}

.icon-th {
  background-position: -240px 0;
}

.icon-th-list {
  background-position: -264px 0;
}

.icon-ok {
  background-position: -288px 0;
}

.icon-remove {
  background-position: -312px 0;
}

.icon-zoom-in {
  background-position: -336px 0;
}

.icon-zoom-out {
  background-position: -360px 0;
}

.icon-off {
  background-position: -384px 0;
}

.icon-signal {
  background-position: -408px 0;
}

.icon-cog {
  background-position: -432px 0;
}

.icon-trash {
  background-position: -456px 0;
}

.icon-home {
  background-position: 0 -24px;
}

.icon-file {
  background-position: -24px -24px;
}

.icon-time {
  background-position: -48px -24px;
}

.icon-road {
  background-position: -72px -24px;
}

.icon-download-alt {
  background-position: -96px -24px;
}

.icon-download {
  background-position: -120px -24px;
}

.icon-upload {
  background-position: -144px -24px;
}

.icon-inbox {
  background-position: -168px -24px;
}

.icon-play-circle {
  background-position: -192px -24px;
}

.icon-repeat {
  background-position: -216px -24px;
}

.icon-refresh {
  background-position: -240px -24px;
}

.icon-list-alt {
  background-position: -264px -24px;
}

.icon-lock {
  background-position: -287px -24px;
}

.icon-flag {
  background-position: -312px -24px;
}

.icon-headphones {
  background-position: -336px -24px;
}

.icon-volume-off {
  background-position: -360px -24px;
}

.icon-volume-down {
  background-position: -384px -24px;
}

.icon-volume-up {
  background-position: -408px -24px;
}

.icon-qrcode {
  background-position: -432px -24px;
}

.icon-barcode {
  background-position: -456px -24px;
}

.icon-tag {
  background-position: 0 -48px;
}

.icon-tags {
  background-position: -25px -48px;
}

.icon-book {
  background-position: -48px -48px;
}

.icon-bookmark {
  background-position: -72px -48px;
}

.icon-print {
  background-position: -96px -48px;
}

.icon-camera {
  background-position: -120px -48px;
}

.icon-font {
  background-position: -144px -48px;
}

.icon-bold {
  background-position: -167px -48px;
}

.icon-italic {
  background-position: -192px -48px;
}

.icon-text-height {
  background-position: -216px -48px;
}

.icon-text-width {
  background-position: -240px -48px;
}

.icon-align-left {
  background-position: -264px -48px;
}

.icon-align-center {
  background-position: -288px -48px;
}

.icon-align-right {
  background-position: -312px -48px;
}

.icon-align-justify {
  background-position: -336px -48px;
}

.icon-list {
  background-position: -360px -48px;
}

.icon-indent-left {
  background-position: -384px -48px;
}

.icon-indent-right {
  background-position: -408px -48px;
}

.icon-facetime-video {
  background-position: -432px -48px;
}

.icon-picture {
  background-position: -456px -48px;
}

.icon-pencil {
  background-position: 0 -72px;
}

.icon-map-marker {
  background-position: -24px -72px;
}

.icon-adjust {
  background-position: -48px -72px;
}

.icon-tint {
  background-position: -72px -72px;
}

.icon-edit {
  background-position: -96px -72px;
}

.icon-share {
  background-position: -120px -72px;
}

.icon-check {
  background-position: -144px -72px;
}

.icon-move {
  background-position: -168px -72px;
}

.icon-step-backward {
  background-position: -192px -72px;
}

.icon-fast-backward {
  background-position: -216px -72px;
}

.icon-backward {
  background-position: -240px -72px;
}

.icon-play {
  background-position: -264px -72px;
}

.icon-pause {
  background-position: -288px -72px;
}

.icon-stop {
  background-position: -312px -72px;
}

.icon-forward {
  background-position: -336px -72px;
}

.icon-fast-forward {
  background-position: -360px -72px;
}

.icon-step-forward {
  background-position: -384px -72px;
}

.icon-eject {
  background-position: -408px -72px;
}

.icon-chevron-left {
  background-position: -432px -72px;
}

.icon-chevron-right {
  background-position: -456px -72px;
}

.icon-plus-sign {
  background-position: 0 -96px;
}

.icon-minus-sign {
  background-position: -24px -96px;
}

.icon-remove-sign {
  background-position: -48px -96px;
}

.icon-ok-sign {
  background-position: -72px -96px;
}

.icon-question-sign {
  background-position: -96px -96px;
}

.icon-info-sign {
  background-position: -120px -96px;
}

.icon-screenshot {
  background-position: -144px -96px;
}

.icon-remove-circle {
  background-position: -168px -96px;
}

.icon-ok-circle {
  background-position: -192px -96px;
}

.icon-ban-circle {
  background-position: -216px -96px;
}

.icon-arrow-left {
  background-position: -240px -96px;
}

.icon-arrow-right {
  background-position: -264px -96px;
}

.icon-arrow-up {
  background-position: -289px -96px;
}

.icon-arrow-down {
  background-position: -312px -96px;
}

.icon-share-alt {
  background-position: -336px -96px;
}

.icon-resize-full {
  background-position: -360px -96px;
}

.icon-resize-small {
  background-position: -384px -96px;
}

.icon-plus {
  background-position: -408px -96px;
}

.icon-minus {
  background-position: -433px -96px;
}

.icon-asterisk {
  background-position: -456px -96px;
}

.icon-exclamation-sign {
  background-position: 0 -120px;
}

.icon-gift {
  background-position: -24px -120px;
}

.icon-leaf {
  background-position: -48px -120px;
}

.icon-fire {
  background-position: -72px -120px;
}

.icon-eye-open {
  background-position: -96px -120px;
}

.icon-eye-close {
  background-position: -120px -120px;
}

.icon-warning-sign {
  background-position: -144px -120px;
}

.icon-plane {
  background-position: -168px -120px;
}

.icon-calendar {
  background-position: -192px -120px;
}

.icon-random {
  width: 16px;
  background-position: -216px -120px;
}

.icon-comment {
  background-position: -240px -120px;
}

.icon-magnet {
  background-position: -264px -120px;
}

.icon-chevron-up {
  background-position: -288px -120px;
}

.icon-chevron-down {
  background-position: -313px -119px;
}

.icon-retweet {
  background-position: -336px -120px;
}

.icon-shopping-cart {
  background-position: -360px -120px;
}

.icon-folder-close {
  width: 16px;
  background-position: -384px -120px;
}

.icon-folder-open {
  width: 16px;
  background-position: -408px -120px;
}

.icon-resize-vertical {
  background-position: -432px -119px;
}

.icon-resize-horizontal {
  background-position: -456px -118px;
}

.icon-hdd {
  background-position: 0 -144px;
}

.icon-bullhorn {
  background-position: -24px -144px;
}

.icon-bell {
  background-position: -48px -144px;
}

.icon-certificate {
  background-position: -72px -144px;
}

.icon-thumbs-up {
  background-position: -96px -144px;
}

.icon-thumbs-down {
  background-position: -120px -144px;
}

.icon-hand-right {
  background-position: -144px -144px;
}

.icon-hand-left {
  background-position: -168px -144px;
}

.icon-hand-up {
  background-position: -192px -144px;
}

.icon-hand-down {
  background-position: -216px -144px;
}

.icon-circle-arrow-right {
  background-position: -240px -144px;
}

.icon-circle-arrow-left {
  background-position: -264px -144px;
}

.icon-circle-arrow-up {
  background-position: -288px -144px;
}

.icon-circle-arrow-down {
  background-position: -312px -144px;
}

.icon-globe {
  background-position: -336px -144px;
}

.icon-wrench {
  background-position: -360px -144px;
}

.icon-tasks {
  background-position: -384px -144px;
}

.icon-filter {
  background-position: -408px -144px;
}

.icon-briefcase {
  background-position: -432px -144px;
}

.icon-fullscreen {
  background-position: -456px -144px;
}

.dropup,
.dropdown {
  position: relative;
}

.dropdown-toggle {
  *margin-bottom: -3px;
}

.dropdown-toggle:active,
.open .dropdown-toggle {
  outline: 0;
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: top;
  border-top: 4px solid #000000;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
}

.dropdown .caret {
  margin-top: 8px;
  margin-left: 2px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  *border-right-width: 2px;
  *border-bottom-width: 2px;
  -webkit-border-radius: 6px;
     -moz-border-radius: 6px;
          border-radius: 6px;
  -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
     -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  -webkit-background-clip: padding-box;
     -moz-background-clip: padding;
          background-clip: padding-box;
}

.dropdown-menu.pull-right {
  right: 0;
  left: auto;
}

.dropdown-menu .divider {
  *width: 100%;
  height: 1px;
  margin: 9px 1px;
  *margin: -5px 0 5px;
  overflow: hidden;
  background-color: #e5e5e5;
  border-bottom: 1px solid #ffffff;
}

.dropdown-menu > li > a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: normal;
  line-height: 20px;
  color: #333333;
  white-space: nowrap;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-submenu:hover > a,
.dropdown-submenu:focus > a {
  color: #ffffff;
  text-decoration: none;
  background-color: #0081c2;
  background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  color: #ffffff;
  text-decoration: none;
  background-color: #0081c2;
  background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  background-repeat: repeat-x;
  outline: 0;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}

.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
  color: #999999;
}

.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
  text-decoration: none;
  cursor: default;
  background-color: transparent;
  background-image: none;
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.open {
  *z-index: 1000;
}

.open > .dropdown-menu {
  display: block;
}

.dropdown-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 990;
}

.pull-right > .dropdown-menu {
  right: 0;
  left: auto;
}

.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
  border-top: 0;
  border-bottom: 4px solid #000000;
  content: "";
}

.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
  top: auto;
  bottom: 100%;
  margin-bottom: 1px;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -6px;
  margin-left: -1px;
  -webkit-border-radius: 0 6px 6px 6px;
     -moz-border-radius: 0 6px 6px 6px;
          border-radius: 0 6px 6px 6px;
}

.dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

.dropup .dropdown-submenu > .dropdown-menu {
  top: auto;
  bottom: 0;
  margin-top: 0;
  margin-bottom: -2px;
  -webkit-border-radius: 5px 5px 5px 0;
     -moz-border-radius: 5px 5px 5px 0;
          border-radius: 5px 5px 5px 0;
}

.dropdown-submenu > a:after {
  display: block;
  float: right;
  width: 0;
  height: 0;
  margin-top: 5px;
  margin-right: -10px;
  border-color: transparent;
  border-left-color: #cccccc;
  border-style: solid;
  border-width: 5px 0 5px 5px;
  content: " ";
}

.dropdown-submenu:hover > a:after {
  border-left-color: #ffffff;
}

.dropdown-submenu.pull-left {
  float: none;
}

.dropdown-submenu.pull-left > .dropdown-menu {
  left: -100%;
  margin-left: 10px;
  -webkit-border-radius: 6px 0 6px 6px;
     -moz-border-radius: 6px 0 6px 6px;
          border-radius: 6px 0 6px 6px;
}

.dropdown .dropdown-menu .nav-header {
  padding-right: 20px;
  padding-left: 20px;
}

.typeahead {
  z-index: 1051;
  margin-top: 2px;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
}

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.well blockquote {
  border-color: #ddd;
  border-color: rgba(0, 0, 0, 0.15);
}

.well-large {
  padding: 24px;
  -webkit-border-radius: 6px;
     -moz-border-radius: 6px;
          border-radius: 6px;
}

.well-small {
  padding: 9px;
  -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
          border-radius: 3px;
}

.fade {
  opacity: 0;
  -webkit-transition: opacity 0.15s linear;
     -moz-transition: opacity 0.15s linear;
       -o-transition: opacity 0.15s linear;
          transition: opacity 0.15s linear;
}

.fade.in {
  opacity: 1;
}

.collapse {
  position: relative;
  height: 0;
  overflow: hidden;
  -webkit-transition: height 0.35s ease;
     -moz-transition: height 0.35s ease;
       -o-transition: height 0.35s ease;
          transition: height 0.35s ease;
}

.collapse.in {
  height: auto;
}

.close {
  float: right;
  font-size: 20px;
  font-weight: bold;
  line-height: 20px;
  color: #000000;
  text-shadow: 0 1px 0 #ffffff;
  opacity: 0.2;
  filter: alpha(opacity=20);
}

.close:hover,
.close:focus {
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.4;
  filter: alpha(opacity=40);
}

button.close {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}

.btn {
  display: inline-block;
  *display: inline;
  padding: 4px 12px;
  margin-bottom: 0;
  *margin-left: .3em;
  font-size: 14px;
  line-height: 20px;
  color: #333333;
  text-align: center;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  vertical-align: middle;
  cursor: pointer;
  background-color: #f5f5f5;
  *background-color: #e6e6e6;
  background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  background-repeat: repeat-x;
  border: 1px solid #cccccc;
  *border: 0;
  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  border-bottom-color: #b3b3b3;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  *zoom: 1;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:hover,
.btn:focus,
.btn:active,
.btn.active,
.btn.disabled,
.btn[disabled] {
  color: #333333;
  background-color: #e6e6e6;
  *background-color: #d9d9d9;
}

.btn:active,
.btn.active {
  background-color: #cccccc \9;
}

.btn:first-child {
  *margin-left: 0;
}

.btn:hover,
.btn:focus {
  color: #333333;
  text-decoration: none;
  background-position: 0 -15px;
  -webkit-transition: background-position 0.1s linear;
     -moz-transition: background-position 0.1s linear;
       -o-transition: background-position 0.1s linear;
          transition: background-position 0.1s linear;
}

.btn:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

.btn.active,
.btn:active {
  background-image: none;
  outline: 0;
  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
     -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
          box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.disabled,
.btn[disabled] {
  cursor: default;
  background-image: none;
  opacity: 0.65;
  filter: alpha(opacity=65);
  -webkit-box-shadow: none;
     -moz-box-shadow: none;
          box-shadow: none;
}

.btn-large {
  padding: 11px 19px;
  font-size: 17.5px;
  -webkit-border-radius: 6px;
     -moz-border-radius: 6px;
          border-radius: 6px;
}

.btn-large [class^="icon-"],
.btn-large [class*=" icon-"] {
  margin-top: 4px;
}

.btn-small {
  padding: 2px 10px;
  font-size: 11.9px;
  -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
          border-radius: 3px;
}

.btn-small [class^="icon-"],
.btn-small [class*=" icon-"] {
  margin-top: 0;
}

.btn-mini [class^="icon-"],
.btn-mini [class*=" icon-"] {
  margin-top: -1px;
}

.btn-mini {
  padding: 0 6px;
  font-size: 10.5px;
  -webkit-border-radius: 3px;
     -moz-border-radius: 3px;
          border-radius: 3px;
}

.btn-block {
  display: block;
  width: 100%;
  padding-right: 0;
  padding-left: 0;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

.btn-block + .btn-block {
  margin-top: 5px;
}

input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
  width: 100%;
}

.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
  color: rgba(255, 255, 255, 0.75);
}

.btn-primary {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #006dcc;
  *background-color: #0044cc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary.disabled,
.btn-primary[disabled] {
  color: #ffffff;
  background-color: #0044cc;
  *background-color: #003bb3;
}

.btn-primary:active,
.btn-primary.active {
  background-color: #003399 \9;
}

.btn-warning {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #faa732;
  *background-color: #f89406;
  background-image: -moz-linear-gradient(top, #fbb450, #f89406);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
  background-image: -o-linear-gradient(top, #fbb450, #f89406);
  background-image: linear-gradient(to bottom, #fbb450, #f89406);
  background-repeat: repeat-x;
  border-color: #f89406 #f89406 #ad6704;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.btn-warning.disabled,
.btn-warning[disabled] {
  color: #ffffff;
  background-color: #f89406;
  *background-color: #df8505;
}

.btn-warning:active,
.btn-warning.active {
  background-color: #c67605 \9;
}

.btn-danger {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #da4f49;
  *background-color: #bd362f;
  background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
  background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
  background-repeat: repeat-x;
  border-color: #bd362f #bd362f #802420;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.btn-danger.disabled,
.btn-danger[disabled] {
  color: #ffffff;
  background-color: #bd362f;
  *background-color: #a9302a;
}

.btn-danger:active,
.btn-danger.active {
  background-color: #942a25 \9;
}

.btn-success {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #5bb75b;
  *background-color: #51a351;
  background-image: -moz-linear-gradient(top, #62c462, #51a351);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
  background-image: -webkit-linear-gradient(top, #62c462, #51a351);
  background-image: -o-linear-gradient(top, #62c462, #51a351);
  background-image: linear-gradient(to bottom, #62c462, #51a351);
  background-repeat: repeat-x;
  border-color: #51a351 #51a351 #387038;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.btn-success.disabled,
.btn-success[disabled] {
  color: #ffffff;
  background-color: #51a351;
  *background-color: #499249;
}

.btn-success:active,
.btn-success.active {
  background-color: #408140 \9;
}

.btn-info {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #49afcd;
  *background-color: #2f96b4;
  background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
  background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
  background-repeat: repeat-x;
  border-color: 
Download .txt
gitextract_fd4ce_x1/

├── .gitignore
├── Fiddler.pem
├── README.md
├── build.sh
├── clean.php
├── config.php
├── plugin/
│   ├── Info.plist
│   ├── README.md
│   ├── build_mac.sh
│   ├── chrome_fiddler.mm
│   ├── chrome_fiddler.plugin/
│   │   └── Contents/
│   │       ├── Info.plist
│   │       └── MacOS/
│   │           └── chrome_fiddler
│   ├── chrome_fiddler_plugin.cc
│   ├── chrome_fiddler_plugin.h
│   ├── chrome_fiddler_script_object.cc
│   ├── chrome_fiddler_script_object.h
│   ├── chrome_fiddler_vs2008_project/
│   │   ├── Debug/
│   │   │   ├── chrome_fiddler.exp
│   │   │   ├── chrome_fiddler.ilk
│   │   │   ├── chrome_fiddler.lib
│   │   │   └── chrome_fiddler.pdb
│   │   ├── Release/
│   │   │   ├── chrome_fiddler.exp
│   │   │   ├── chrome_fiddler.lib
│   │   │   └── chrome_fiddler.pdb
│   │   ├── chrome_fiddler/
│   │   │   ├── chrome_fiddler.aps
│   │   │   ├── chrome_fiddler.def
│   │   │   ├── chrome_fiddler.rc
│   │   │   ├── chrome_fiddler.vcproj
│   │   │   └── resource.h
│   │   ├── chrome_fiddler.ncb
│   │   ├── chrome_fiddler.sln
│   │   └── chrome_fiddler.suo
│   ├── log.cc
│   ├── log.h
│   ├── np_entry.cc
│   ├── npapi.h
│   ├── npfunctions.h
│   ├── npn_entry.cc
│   ├── npp_entry.cc
│   ├── npruntime.h
│   ├── nptypes.h
│   ├── plugin_base.cc
│   ├── plugin_base.h
│   ├── plugin_factory.cc
│   ├── plugin_factory.h
│   ├── script_object_base.cc
│   ├── script_object_base.h
│   ├── script_object_factory.cc
│   ├── script_object_factory.h
│   └── utils.h
├── src/
│   ├── bin/
│   │   └── chrome_fiddler.plugin/
│   │       └── Contents/
│   │           ├── Info.plist
│   │           └── MacOS/
│   │               └── chrome_fiddler
│   ├── css/
│   │   ├── lib/
│   │   │   ├── bootstrap.css
│   │   │   ├── fiddler.css
│   │   │   └── shCoreDefault.css
│   │   ├── lib.css
│   │   └── page/
│   │       └── options.css
│   ├── html/
│   │   ├── background.html
│   │   ├── devtools.html
│   │   └── options.html
│   ├── img/
│   │   └── icon.psd
│   ├── js/
│   │   ├── component/
│   │   │   ├── config.js
│   │   │   ├── event.js
│   │   │   ├── file.js
│   │   │   ├── resource.js
│   │   │   └── rule.js
│   │   ├── component.js
│   │   ├── lib/
│   │   │   ├── MimeTea.js
│   │   │   ├── SyntaxHighlighter/
│   │   │   │   ├── shBrushCss.js
│   │   │   │   ├── shBrushJScript.js
│   │   │   │   └── shCore.js
│   │   │   ├── base64.js
│   │   │   ├── beautify/
│   │   │   │   ├── beautify_css.js
│   │   │   │   ├── beautify_html.js
│   │   │   │   └── beautify_js.js
│   │   │   ├── bootstrap.js
│   │   │   ├── fiddler.js
│   │   │   ├── jquery.js
│   │   │   └── when.js
│   │   ├── lib.js
│   │   └── page/
│   │       ├── background.js
│   │       ├── devtools.js
│   │       └── options.js
│   └── manifest.json
└── test/
    ├── css/
    │   └── base.css
    └── index.html
Download .txt
SYMBOL INDEX (332 symbols across 35 files)

FILE: plugin/chrome_fiddler_plugin.cc
  function NPError (line 12) | NPError ChromeFiddlerPlugin::Init(NPP instance, uint16_t mode, int16_t a...
  function NPError (line 43) | NPError ChromeFiddlerPlugin::UnInit(NPSavedData** save) {
  function NPError (line 51) | NPError ChromeFiddlerPlugin::GetValue(NPPVariable variable, void *value) {
  function NPError (line 70) | NPError ChromeFiddlerPlugin::SetWindow(NPWindow* window) {

FILE: plugin/chrome_fiddler_plugin.h
  function class (line 10) | class ChromeFiddlerPlugin : public PluginBase {

FILE: plugin/chrome_fiddler_script_object.cc
  type BrowserParam (line 25) | struct BrowserParam {
  function NPObject (line 35) | NPObject* ChromeFiddlerScriptObject::Allocate(NPP npp, NPClass *aClass) {
  function BrowserCallback (line 67) | int WINAPI BrowserCallback(NativeWindow nw, UINT uMsg, LPARAM lParam, LP...

FILE: plugin/chrome_fiddler_script_object.h
  function class (line 7) | class ChromeFiddlerScriptObject: public ScriptObjectBase {

FILE: plugin/log.cc
  type tm (line 35) | struct tm
  type tm (line 56) | struct tm

FILE: plugin/log.h
  function class (line 10) | class Log {

FILE: plugin/np_entry.cc
  function NPError (line 28) | NPError OSCALL NP_GetEntryPoints(NPPluginFuncs* nppfuncs) {
  function NPError (line 70) | NPError OSCALL NP_Shutdown() {
  function NPError (line 82) | NPError OSCALL NP_GetValue(void* npp, NPPVariable variable, void* value) {

FILE: plugin/npapi.h
  type NPBool (line 153) | typedef unsigned char NPBool;
  type NPError (line 154) | typedef int16_t       NPError;
  type NPReason (line 155) | typedef int16_t       NPReason;
  type NPP_t (line 171) | typedef struct _NPP
  type NPP_t (line 177) | typedef NPP_t*  NPP;
  type NPStream (line 179) | typedef struct _NPStream
  type NPByteRange (line 199) | typedef struct _NPByteRange
  type NPSavedData (line 206) | typedef struct _NPSavedData
  type NPRect (line 212) | typedef struct _NPRect
  type NPSize (line 220) | typedef struct _NPSize
  type NPFocusDirection (line 226) | typedef enum {
  type NPAnyCallbackStruct (line 252) | typedef struct
  type NPSetWindowCallbackStruct (line 257) | typedef struct
  type NPPrintCallbackStruct (line 268) | typedef struct
  type NPDrawingModel (line 277) | typedef enum {
  type NPEventModel (line 287) | typedef enum {
  type NPPVariable (line 331) | typedef enum {
  type NPNVariable (line 388) | typedef enum {
  type NPNURLVariable (line 434) | typedef enum {
  type NPNToolkitType (line 442) | typedef enum {
  type NPWindowType (line 451) | typedef enum {
  type NPWindow (line 456) | typedef struct _NPWindow
  type NPImageExpose (line 472) | typedef struct _NPImageExpose
  type NPFullPrint (line 488) | typedef struct _NPFullPrint
  type NPEmbedPrint (line 496) | typedef struct _NPEmbedPrint
  type NPPrint (line 502) | typedef struct _NPPrint
  type EventRecord (line 514) | typedef EventRecord NPEvent;
  type QEvent (line 517) | typedef QEvent NPEvent;
  type NPEvent (line 519) | typedef struct _NPEvent
  type NPEvent (line 526) | typedef struct _NPEvent
  type XEvent (line 533) | typedef XEvent NPEvent;
  type RgnHandle (line 541) | typedef RgnHandle NPQDRegion;
  type CGPathRef (line 543) | typedef CGPathRef NPCGRegion;
  type HRGN (line 545) | typedef HRGN NPRegion;
  type Region (line 547) | typedef Region NPRegion;
  type QRegion (line 549) | typedef QRegion* NPRegion;
  type NPNSString (line 554) | typedef struct _NPNSString NPNSString;
  type NPNSWindow (line 555) | typedef struct _NPNSWindow NPNSWindow;
  type NPNSMenu (line 556) | typedef struct _NPNSMenu   NPNSMenu;
  type NPNSMenu (line 559) | typedef NPNSMenu NPMenu;
  type NPCoordinateSpace (line 564) | typedef enum {
  type NP_Port (line 575) | typedef struct NP_Port
  type NP_CGContext (line 588) | typedef struct NP_CGContext
  type NP_GLContext (line 599) | typedef struct NP_GLContext
  type NPCocoaEventType (line 609) | typedef enum {
  type NPCocoaEvent (line 626) | typedef struct _NPCocoaEvent {
  type NPEventType (line 665) | enum NPEventType {

FILE: plugin/npfunctions.h
  type NPError (line 53) | typedef NPError      (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType,...
  type NPError (line 54) | typedef NPError      (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance, NPSa...
  type NPError (line 55) | typedef NPError      (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance, NP...
  type NPError (line 56) | typedef NPError      (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance, NP...
  type NPError (line 57) | typedef NPError      (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance...
  type NPError (line 66) | typedef NPError      (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance, NPP...
  type NPError (line 67) | typedef NPError      (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance, NPN...
  type NPError (line 69) | typedef NPError      (*NPN_GetValueProcPtr)(NPP instance, NPNVariable va...
  type NPError (line 70) | typedef NPError      (*NPN_SetValueProcPtr)(NPP instance, NPPVariable va...
  type NPError (line 71) | typedef NPError      (*NPN_GetURLNotifyProcPtr)(NPP instance, const char...
  type NPError (line 72) | typedef NPError      (*NPN_PostURLNotifyProcPtr)(NPP instance, const cha...
  type NPError (line 73) | typedef NPError      (*NPN_GetURLProcPtr)(NPP instance, const char* url,...
  type NPError (line 74) | typedef NPError      (*NPN_PostURLProcPtr)(NPP instance, const char* url...
  type NPError (line 75) | typedef NPError      (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteR...
  type NPError (line 76) | typedef NPError      (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType ty...
  type NPError (line 78) | typedef NPError      (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream*...
  type NPIdentifier (line 92) | typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr)(const NPUTF8* name);
  type NPIdentifier (line 94) | typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr)(int32_t intid);
  type NPUTF8 (line 96) | typedef NPUTF8*      (*NPN_UTF8FromIdentifierProcPtr)(NPIdentifier ident...
  type NPObject (line 98) | typedef NPObject*    (*NPN_CreateObjectProcPtr)(NPP npp, NPClass *aClass);
  type NPObject (line 99) | typedef NPObject*    (*NPN_RetainObjectProcPtr)(NPObject *obj);
  type NPError (line 116) | typedef NPError      (*NPN_GetValueForURLPtr)(NPP npp, NPNURLVariable va...
  type NPError (line 117) | typedef NPError      (*NPN_SetValueForURLPtr)(NPP npp, NPNURLVariable va...
  type NPError (line 118) | typedef NPError      (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char...
  type NPPluginFuncs (line 120) | typedef struct _NPPluginFuncs {
  type NPNetscapeFuncs (line 139) | typedef struct _NPNetscapeFuncs {
  type BPSupportedMIMETypes (line 205) | typedef struct _BPSupportedMIMETypes
  type OSErr (line 214) | typedef OSErr (*BP_GetSupportedMIMETypesProcPtr)(BPSupportedMIMETypes*, ...
  type NPPluginData (line 245) | typedef struct _NPPluginData {   /* Alternate OS2 Plugin interface */

FILE: plugin/npn_entry.cc
  function NPN_Version (line 5) | void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor, int* ne...
  function NPError (line 12) | NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url, const ...
  function NPError (line 16) | NPError NP_LOADDS NPN_GetURL(NPP instance,const char* url,const char* ta...
  function NPError (line 20) | NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url, const...
  function NPError (line 24) | NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,const char* ...
  function NPError (line 28) | NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeLi...
  function NPError (line 32) | NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, const cha...
  function NPN_Write (line 36) | int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,...
  function NPError (line 40) | NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPRe...
  function NPN_Status (line 44) | void NP_LOADDS NPN_Status(NPP instance, const char* message) {
  function NPN_MemFree (line 56) | void NP_LOADDS NPN_MemFree(void* ptr) {
  function NPN_MemFlush (line 60) | uint32_t NP_LOADDS NPN_MemFlush(uint32_t size) {
  function NPN_ReloadPlugins (line 64) | void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages) {
  function NPError (line 68) | NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void ...
  function NPError (line 72) | NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void ...
  function NPN_InvalidateRect (line 76) | void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect) {
  function NPN_InvalidateRegion (line 80) | void NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) {
  function NPN_ForceRedraw (line 84) | void NP_LOADDS NPN_ForceRedraw(NPP instance) {
  function NPN_PushPopupsEnabledState (line 88) | void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) {
  function NPN_PopPopupsEnabledState (line 92) | void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance) {
  function NPN_PluginThreadAsyncCall (line 95) | void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,void (*func) (void...
  function NPError (line 99) | NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variab...
  function NPError (line 103) | NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variab...
  function NPError (line 106) | NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance, const char *pr...
  function NPObject (line 110) | NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) {
  function NPObject (line 114) | NPObject *NPN_RetainObject(NPObject *npobj) {
  function NPN_ReleaseObject (line 118) | void NPN_ReleaseObject(NPObject *npobj) {
  function NPN_Invoke (line 122) | bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const...
  function NPN_InvokeDefault (line 126) | bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, ...
  function NPN_Evaluate (line 130) | bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant ...
  function NPN_GetProperty (line 134) | bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName...
  function NPN_SetProperty (line 138) | bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName...
  function NPN_RemoveProperty (line 142) | bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyN...
  function NPN_HasProperty (line 146) | bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) {
  function NPN_HasMethod (line 150) | bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName) {
  function NPN_Enumerate (line 154) | bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, ...
  function NPN_Construct (line 158) | bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint...
  function NPN_SetException (line 162) | void NPN_SetException(NPObject *npobj, const NPUTF8 *message) {
  function NPIdentifier (line 166) | NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) {
  function NPN_GetStringIdentifiers (line 170) | void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, N...
  function NPIdentifier (line 174) | NPIdentifier NPN_GetIntIdentifier(int32_t intid) {
  function NPN_IdentifierIsString (line 178) | bool NPN_IdentifierIsString(NPIdentifier identifier) {
  function NPUTF8 (line 182) | NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) {
  function NPN_IntFromIdentifier (line 186) | int32_t NPN_IntFromIdentifier(NPIdentifier identifier) {
  function NPN_ReleaseVariantValue (line 190) | void NPN_ReleaseVariantValue(NPVariant *variant) {

FILE: plugin/npp_entry.cc
  function NPError (line 14) | NPError NP_LOADDS NPP_Initialize() {
  function NPP_Shutdown (line 18) | void NP_LOADDS NPP_Shutdown() {
  function NPError (line 21) | NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, uint16_t ...
  function NPError (line 30) | NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save) {
  function NPError (line 36) | NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window) {
  function NPError (line 41) | NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, NPStream*...
  function NPError (line 46) | NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, NPRe...
  function NPP_WriteReady (line 51) | int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream) {
  function NPP_Write (line 56) | int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offs...
  function NPP_StreamAsFile (line 61) | void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, const ch...
  function NPP_Print (line 66) | void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint) {
  function NPP_HandleEvent (line 71) | int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event) {
  function NPP_URLNotify (line 76) | void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, NPReason rea...
  function NPError (line 81) | NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void ...
  function NPError (line 96) | NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void ...

FILE: plugin/npruntime.h
  type NPObject (line 113) | typedef struct NPObject NPObject;
  type NPClass (line 114) | typedef struct NPClass NPClass;
  type NPUTF8 (line 116) | typedef char NPUTF8;
  type NPString (line 117) | typedef struct _NPString {
  type NPVariantType (line 122) | typedef enum {
  type NPVariant (line 132) | typedef struct _NPVariant {
  type NPObject (line 279) | typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass);
  type NPClass (line 327) | struct NPClass
  type NPObject (line 355) | struct NPObject {

FILE: plugin/nptypes.h
  type u_int32_t (line 76) | typedef u_int32_t uint32_t;

FILE: plugin/plugin_base.cc
  function NPError (line 9) | NPError PluginBase::Init(NPP instance, uint16_t mode, int16_t argc, char...
  function NPError (line 14) | NPError PluginBase::UnInit(NPSavedData** save) {
  function NPError (line 18) | NPError PluginBase::SetWindow(NPWindow* window) {
  function NPError (line 23) | NPError PluginBase::NewStream(NPMIMEType type, NPStream* stream, NPBool ...
  function NPError (line 27) | NPError PluginBase::DestroyStream(NPStream* stream, NPReason reason) {
  function NPError (line 52) | NPError PluginBase::GetValue(NPPVariable variable, void *value) {
  function NPError (line 56) | NPError PluginBase::SetValue(NPNVariable variable, void *value) {

FILE: plugin/plugin_base.h
  type HWND (line 7) | typedef HWND NativeWindow;
  type NP_CGContext (line 10) | typedef NP_CGContext* NativeWindow;
  function class (line 14) | class PluginBase {

FILE: plugin/plugin_factory.cc
  function PluginBase (line 13) | PluginBase* PluginFactory::NewPlugin(NPMIMEType pluginType) {

FILE: plugin/plugin_factory.h
  type PluginBase (line 9) | typedef PluginBase* (*ConstructorPtr)();
  function class (line 11) | class PluginFactory {

FILE: plugin/script_object_base.h
  function class (line 11) | class ScriptObjectBase : public NPObject {

FILE: plugin/script_object_factory.cc
  function ScriptObjectBase (line 25) | ScriptObjectBase* ScriptObjectFactory::CreateObject(NPP npp, NPAllocateF...
  function NPObject (line 34) | NPObject* ScriptObjectFactory::Allocate(NPP npp, NPClass *aClass) {

FILE: plugin/script_object_factory.h
  function class (line 6) | class ScriptObjectFactory {

FILE: plugin/utils.h
  function namespace (line 10) | namespace utils {
  function class (line 30) | class Utf8ToUnicode {

FILE: src/js/component/event.js
  function init (line 7) | function init(cleanCheckHandler){

FILE: src/js/component/file.js
  function encodeText (line 12) | function encodeText(text, type){
  function getMimeType (line 26) | function getMimeType(file) {

FILE: src/js/lib/MimeTea.js
  function spoon (line 666) | function spoon(SugarType){

FILE: src/js/lib/SyntaxHighlighter/shBrushCss.js
  function Brush (line 22) | function Brush()

FILE: src/js/lib/SyntaxHighlighter/shBrushJScript.js
  function Brush (line 22) | function Brush()

FILE: src/js/lib/SyntaxHighlighter/shCore.js
  function r (line 3) | function r(f, e) {
  function t (line 13) | function t(f) {
  function B (line 16) | function B(f, e, a, b) {
  function p (line 43) | function p(f, e, a) {
  function r (line 335) | function r(a, b) {
  function t (line 338) | function t(a) {
  function B (line 341) | function B(a) {
  function p (line 344) | function p(a, b, c) {
  function C (line 358) | function C(a, b) {
  function w (line 365) | function w(a, b, c, d) {
  function A (line 378) | function A(a, b) {
  function v (line 397) | function v(a, b) {
  function u (line 401) | function u(a, b) {
  function n (line 423) | function n(a, b) {
  function x (line 433) | function x(a) {
  function D (line 436) | function D(a, b) {
  function y (line 443) | function y(a, b) {
  function E (line 454) | function E(a) {
  function z (line 467) | function z() {
  function f (line 471) | function f(a) {
  function b (line 555) | function b(i, k) {
  function b (line 694) | function b(j, l) {
  function c (line 838) | function c(l) {

FILE: src/js/lib/beautify/beautify_css.js
  function css_beautify (line 57) | function css_beautify(source_text, options) {

FILE: src/js/lib/beautify/beautify_html.js
  function trim (line 69) | function trim(s) {
  function ltrim (line 73) | function ltrim(s) {
  function style_html (line 77) | function style_html(html_source, options, js_beautify, css_beautify) {

FILE: src/js/lib/beautify/beautify_js.js
  function js_beautify (line 78) | function js_beautify(js_source_text, options) {
  function Beautifier (line 84) | function Beautifier(js_source_text, options) {

FILE: src/js/lib/bootstrap.js
  function removeElement (line 115) | function removeElement() {
  function clearMenus (line 743) | function clearMenus() {
  function getParent (line 750) | function getParent($this) {
  function removeWithAnimation (line 1282) | function removeWithAnimation() {
  function ScrollSpy (line 1553) | function ScrollSpy(element, options) {
  function next (line 1764) | function next() {

FILE: src/js/lib/jquery.js
  function isArraylike (line 983) | function isArraylike( obj ) {
  function Sizzle (line 1183) | function Sizzle( selector, context, results, seed ) {
  function createCache (line 1298) | function createCache() {
  function markFunction (line 1316) | function markFunction( fn ) {
  function assert (line 1325) | function assert( fn ) {
  function addHandle (line 1347) | function addHandle( attrs, handler ) {
  function siblingCheck (line 1362) | function siblingCheck( a, b ) {
  function createInputPseudo (line 1389) | function createInputPseudo( type ) {
  function createButtonPseudo (line 1400) | function createButtonPseudo( type ) {
  function createPositionalPseudo (line 1411) | function createPositionalPseudo( fn ) {
  function setFilters (line 2394) | function setFilters() {}
  function tokenize (line 2398) | function tokenize( selector, parseOnly ) {
  function toSelector (line 2465) | function toSelector( tokens ) {
  function addCombinator (line 2475) | function addCombinator( matcher, combinator, base ) {
  function elementMatcher (line 2525) | function elementMatcher( matchers ) {
  function condense (line 2539) | function condense( unmatched, map, filter, context, xml ) {
  function setMatcher (line 2560) | function setMatcher( preFilter, selector, matcher, postFilter, postFinde...
  function matcherFromTokens (line 2653) | function matcherFromTokens( tokens ) {
  function matcherFromGroupMatchers (line 2708) | function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  function multipleContexts (line 2836) | function multipleContexts( selector, contexts, results ) {
  function select (line 2845) | function select( selector, context, results, seed ) {
  function createOptions (line 2985) | function createOptions( options ) {
  function internalData (line 3568) | function internalData( elem, name, data, pvt /* Internal Use Only */ ){
  function internalRemoveData (line 3657) | function internalRemoveData( elem, name, pvt ) {
  function dataAttr (line 3854) | function dataAttr( elem, key, data ) {
  function isEmptyDataObject (line 3886) | function isEmptyDataObject( obj ) {
  function returnTrue (line 4712) | function returnTrue() {
  function returnFalse (line 4716) | function returnFalse() {
  function safeActiveElement (line 4720) | function safeActiveElement() {
  function sibling (line 5838) | function sibling( cur, dir ) {
  function winnow (line 5956) | function winnow( elements, qualifier, not ) {
  function createSafeFragment (line 5984) | function createSafeFragment( document ) {
  function manipulationTarget (line 6298) | function manipulationTarget( elem, content ) {
  function disableScript (line 6308) | function disableScript( elem ) {
  function restoreScript (line 6312) | function restoreScript( elem ) {
  function setGlobalEval (line 6323) | function setGlobalEval( elems, refElements ) {
  function cloneCopyEvent (line 6331) | function cloneCopyEvent( src, dest ) {
  function fixCloneNodeIssues (line 6359) | function fixCloneNodeIssues( src, dest ) {
  function getAll (line 6452) | function getAll( context, tag ) {
  function fixDefaultChecked (line 6475) | function fixDefaultChecked( elem ) {
  function vendorPropName (line 6817) | function vendorPropName( style, name ) {
  function isHidden (line 6839) | function isHidden( elem, el ) {
  function showHide (line 6846) | function showHide( elements, show ) {
  function setPositiveNumber (line 7175) | function setPositiveNumber( elem, value, subtract ) {
  function augmentWidthOrHeight (line 7183) | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  function getWidthOrHeight (line 7222) | function getWidthOrHeight( elem, name, extra ) {
  function css_defaultDisplay (line 7266) | function css_defaultDisplay( nodeName ) {
  function actualDisplay (line 7298) | function actualDisplay( name, doc ) {
  function buildParams (line 7527) | function buildParams( prefix, obj, traditional, add ) {
  function addToPrefiltersOrTransports (line 7642) | function addToPrefiltersOrTransports( structure ) {
  function inspectPrefiltersOrTransports (line 7674) | function inspectPrefiltersOrTransports( structure, options, originalOpti...
  function ajaxExtend (line 7701) | function ajaxExtend( target, src ) {
  function done (line 8149) | function done( status, nativeStatusText, responses, headers ) {
  function ajaxHandleResponses (line 8296) | function ajaxHandleResponses( s, jqXHR, responses ) {
  function ajaxConvert (line 8351) | function ajaxConvert( s, response, jqXHR, isSuccess ) {
  function createStandardXHR (line 8619) | function createStandardXHR() {
  function createActiveXHR (line 8625) | function createActiveXHR() {
  function createFxNow (line 8871) | function createFxNow() {
  function createTween (line 8878) | function createTween( value, prop, animation ) {
  function Animation (line 8892) | function Animation( elem, properties, options ) {
  function propFilter (line 8996) | function propFilter( props, specialEasing ) {
  function defaultPrefilter (line 9063) | function defaultPrefilter( elem, props, opts ) {
  function Tween (line 9188) | function Tween( elem, options, prop, end, easing ) {
  function genFx (line 9412) | function genFx( type, includeWidth ) {
  function getWindow (line 9708) | function getWindow( elem ) {

FILE: src/js/lib/when.js
  function when (line 52) | function when(promiseOrValue, onFulfilled, onRejected, onProgress) {
  function Promise (line 65) | function Promise(then, inspect) {
  function injectHandler (line 93) | function injectHandler() {
  function resolve (line 146) | function resolve(value) {
  function reject (line 162) | function reject(promiseOrValue) {
  function defer (line 183) | function defer() {
  function promise (line 227) | function promise(resolver) {
  function _promise (line 239) | function _promise(resolver, status) {
  function coerce (line 333) | function coerce(x) {
  function fulfilled (line 370) | function fulfilled(value) {
  function rejected (line 391) | function rejected(reason) {
  function progressing (line 412) | function progressing(update) {
  function scheduleHandlers (line 432) | function scheduleHandlers(handlers, value) {
  function isPromise (line 447) | function isPromise(promiseOrValue) {
  function some (line 467) | function some(promisesOrValues, howMany, onFulfilled, onRejected, onProg...
  function any (line 537) | function any(promisesOrValues, onFulfilled, onRejected, onProgress) {
  function all (line 559) | function all(promisesOrValues, onFulfilled, onRejected, onProgress) {
  function join (line 568) | function join(/* ...promises */) {
  function settle (line 581) | function settle(array) {
  function map (line 593) | function map(array, mapFunc) {
  function _map (line 605) | function _map(array, mapFunc, fallback) {
  function reduce (line 658) | function reduce(promise, reduceFunc /*, initialValue */) {
  function toFulfilledState (line 688) | function toFulfilledState(x) {
  function toRejectedState (line 698) | function toRejectedState(x) {
  function toPendingState (line 707) | function toPendingState() {
  function enqueue (line 732) | function enqueue(task) {
  function drainQueue (line 743) | function drainQueue() {
  function identity (line 828) | function identity(x) {

FILE: src/js/page/devtools.js
  function addListener (line 2) | function addListener(){

FILE: src/js/page/options.js
  function getItemHtml (line 8) | function getItemHtml(data){
  function getItemRuleHtml (line 19) | function getItemRuleHtml(data){
  function getTypeFile (line 30) | function getTypeFile(type){
  function bindCompleteEvent (line 46) | function bindCompleteEvent(){
  function bindRequestEvent (line 57) | function bindRequestEvent(){
  function bindAutoResponseEvent (line 257) | function bindAutoResponseEvent(){
  function setRuleEditEnable (line 419) | function setRuleEditEnable(enable){
  function setRuleListEnable (line 430) | function setRuleListEnable(enable){
  function saveRules (line 440) | function saveRules(){
  function initData (line 455) | function initData(){
  function openFiles (line 482) | function openFiles(type){
  function clearRequest (line 491) | function clearRequest(){
  function initTools (line 496) | function initTools(){
  function initFilter (line 509) | function initFilter(){
  function fileErrorCallback (line 541) | function fileErrorCallback(data){
  function getContentFromDevTools (line 545) | function getContentFromDevTools(){
  function init (line 560) | function init(){
Condensed preview — 85 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,004K chars).
[
  {
    "path": ".gitignore",
    "chars": 8,
    "preview": "output/\n"
  },
  {
    "path": "Fiddler.pem",
    "chars": 916,
    "preview": "-----BEGIN PRIVATE KEY-----\nMIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKyyd3FMz631KwQ6A\noKT4lmDkKHvDf0H9NkgP0lcHz1"
  },
  {
    "path": "README.md",
    "chars": 166,
    "preview": "[WARNING] 该项目停止维护,愿意维护的同学请联系 welefen@gmail.com,可以把项目转给你。\n\nFiddler\n=======\n\nFiddler for Chrome Extension\n\nvisit http://we"
  },
  {
    "path": "build.sh",
    "chars": 676,
    "preview": "#!/bin/sh\nSTC_PATH=\"/Users/welefen/Develop/git/stc/src\"\npath=`dirname $0`;\nfirst=${path:0:1};\nif [[ $first != '/' ]];the"
  },
  {
    "path": "clean.php",
    "chars": 240,
    "preview": "<?php\n$file = \"output/Fiddler/manifest.json\";\n$content = file_get_contents($file);\n$data = json_decode($content, true);\n"
  },
  {
    "path": "config.php",
    "chars": 1285,
    "preview": "<?php\nreturn array (\n\t'TPL_ENGINE' => 'smarty',  //模版引擎,支持Smarty和PHP\n\t'TPL_LEFT_DELIMITER' => '{%',  //smarty左界符\n\t'TPL_R"
  },
  {
    "path": "plugin/Info.plist",
    "chars": 1741,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "plugin/README.md",
    "chars": 1468,
    "preview": "* prototype from [chrome-screen-capture](http://chrome-screen-capture.googlecode.com/svn/trunk/src/plugin)\n\n## Summary\n\n"
  },
  {
    "path": "plugin/build_mac.sh",
    "chars": 732,
    "preview": "#!/bin/sh\nmkdir -p chrome_fiddler.plugin/Contents/MacOS\ncp -f Info.plist chrome_fiddler.plugin/Contents\ng++ -framework C"
  },
  {
    "path": "plugin/chrome_fiddler.mm",
    "chars": 1178,
    "preview": "#include <string>\n#import <Cocoa/Cocoa.h>\n\n\nstd::string GetFilePathNS(const char* path, const char* dialog_title, bool i"
  },
  {
    "path": "plugin/chrome_fiddler.plugin/Contents/Info.plist",
    "chars": 1741,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "plugin/chrome_fiddler_plugin.cc",
    "chars": 2394,
    "preview": "#include \"chrome_fiddler_plugin.h\"\n\n#include <string.h>\n\n#include \"log.h\"\n#include \"chrome_fiddler_script_object.h\"\n#inc"
  },
  {
    "path": "plugin/chrome_fiddler_plugin.h",
    "chars": 726,
    "preview": "#ifndef CHROME_FIDDLER_PLUGIN_H_\n#define CHROME_FIDDLER_PLUGIN_H_\n\n#include \"npapi.h\"\n#include \"npruntime.h\"\n#include \"n"
  },
  {
    "path": "plugin/chrome_fiddler_script_object.cc",
    "chars": 9280,
    "preview": "#include \"chrome_fiddler_script_object.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef _WINDOWS\n#include <atlenc.h>\n"
  },
  {
    "path": "plugin/chrome_fiddler_script_object.h",
    "chars": 988,
    "preview": "#ifndef CHROME_FIDDLER_SCRIPT_OBJECT_H_\n#define CHROME_FIDDLER_SCRIPT_OBJECT_H_\n\n#include \"npfunctions.h\"\n#include \"scri"
  },
  {
    "path": "plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.def",
    "chars": 143,
    "preview": "LIBRARY\t\"chrome_fiddler\"\r\n\r\nEXPORTS\r\n\tNP_GetEntryPoints     @1\r\n\tNP_Initialize         @2\r\n\tNP_Shutdown           @3\r\n\tN"
  },
  {
    "path": "plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.rc",
    "chars": 3434,
    "preview": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#include \"resource.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n////"
  },
  {
    "path": "plugin/chrome_fiddler_vs2008_project/chrome_fiddler/chrome_fiddler.vcproj",
    "chars": 5876,
    "preview": "<?xml version=\"1.0\" encoding=\"gb2312\"?>\r\n<VisualStudioProject\r\n\tProjectType=\"Visual C++\"\r\n\tVersion=\"9.00\"\r\n\tName=\"chrome"
  },
  {
    "path": "plugin/chrome_fiddler_vs2008_project/chrome_fiddler/resource.h",
    "chars": 377,
    "preview": "//{{NO_DEPENDENCIES}}\r\n// Microsoft Visual C++ generated include file.\r\n// Used by chrome_fiddler.rc\r\n\r\n// ¶һĬֵ\r\n// \r\n#i"
  },
  {
    "path": "plugin/chrome_fiddler_vs2008_project/chrome_fiddler.sln",
    "chars": 906,
    "preview": "\r\nMicrosoft Visual Studio Solution File, Format Version 10.00\r\n# Visual Studio 2008\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-"
  },
  {
    "path": "plugin/log.cc",
    "chars": 1702,
    "preview": "#include \"log.h\"\n\n#include <stdlib.h>\n\n#ifndef _WINDOWS\n#include <sys/time.h>\n#include <time.h>\n#include <unistd.h>\n#end"
  },
  {
    "path": "plugin/log.h",
    "chars": 350,
    "preview": "#ifndef LOG_H_\n#define LOG_H_\n\n#include <stdio.h>\n\n#ifdef _WINDOWS\n#include <windows.h>\n#endif\n\nclass Log {\npublic:\n    "
  },
  {
    "path": "plugin/np_entry.cc",
    "chars": 2193,
    "preview": "#include <stdio.h>\n\n#include \"log.h\"\n#include \"npapi.h\"\n#include \"npfunctions.h\"\n#include \"plugin_factory.h\"\n\n#ifdef _WI"
  },
  {
    "path": "plugin/npapi.h",
    "chars": 27895,
    "preview": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Vers"
  },
  {
    "path": "plugin/npfunctions.h",
    "chars": 13838,
    "preview": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Vers"
  },
  {
    "path": "plugin/npn_entry.cc",
    "chars": 6988,
    "preview": "#include \"npfunctions.h\"\n\nNPNetscapeFuncs* g_npn_funcs;\n\nvoid NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor"
  },
  {
    "path": "plugin/npp_entry.cc",
    "chars": 3324,
    "preview": "#include \"log.h\"\n#include \"npfunctions.h\"\n#include \"plugin_base.h\"\n#include \"plugin_factory.h\"\n\nextern Log g_logger;\n\n#i"
  },
  {
    "path": "plugin/npruntime.h",
    "chars": 17525,
    "preview": "/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/*\n * Copyright (c) 2004, Apple Computer, "
  },
  {
    "path": "plugin/nptypes.h",
    "chars": 3668,
    "preview": "/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Vers"
  },
  {
    "path": "plugin/plugin_base.cc",
    "chars": 1343,
    "preview": "#include \"plugin_base.h\"\n\nPluginBase::PluginBase(void) {\n}\n\nPluginBase::~PluginBase(void) {\n}\n\nNPError PluginBase::Init("
  },
  {
    "path": "plugin/plugin_base.h",
    "chars": 1482,
    "preview": "#ifndef PLUGIN_BASE_H_\n#define PLUGIN_BASE_H_\n\n#include \"npapi.h\"\n\n#ifdef _WINDOWS\ntypedef HWND NativeWindow;\n#elif defi"
  },
  {
    "path": "plugin/plugin_factory.cc",
    "chars": 643,
    "preview": "#include \"plugin_factory.h\"\n#include \"chrome_fiddler_plugin.h\"\n\nPluginFactory::PluginTypeMap PluginFactory::plugin_type_"
  },
  {
    "path": "plugin/plugin_factory.h",
    "chars": 568,
    "preview": "#ifndef PLUGIN_FACTORY_H_\n#define PLUGIN_FACTORY_H_\n\n#include <map>\n#include <string>\n\n#include \"plugin_base.h\"\n\ntypedef"
  },
  {
    "path": "plugin/script_object_base.cc",
    "chars": 2938,
    "preview": "#include \"script_object_base.h\"\n#include \"utils.h\"\n\nbool ScriptObjectBase::HasMethod(NPIdentifier name) {\n    bool ret ="
  },
  {
    "path": "plugin/script_object_base.h",
    "chars": 1953,
    "preview": "#ifndef SCRIPT_OBJECT_BASE_H_\n#define SCRIPT_OBJECT_BASE_H_\n\n#include <map>\n#include <string>\n\n#include \"npapi.h\"\n#inclu"
  },
  {
    "path": "plugin/script_object_factory.cc",
    "chars": 3187,
    "preview": "#include \"script_object_factory.h\"\n\nNPClass ScriptObjectFactory::npclass_ = {\n    NP_CLASS_STRUCT_VERSION,\n    ScriptObj"
  },
  {
    "path": "plugin/script_object_factory.h",
    "chars": 1308,
    "preview": "#ifndef SCRIPT_OBJECT_FACTORY_H_\n#define SCRIPT_OBJECT_FACTORY_H_\n\n#include \"script_object_base.h\"\n\nclass ScriptObjectFa"
  },
  {
    "path": "plugin/utils.h",
    "chars": 1373,
    "preview": "#ifndef UTIL_H_\n#define UTIL_H_\n\n#ifdef _WINDOWS\n#include <windows.h>\n#endif\n\n#include \"npfunctions.h\"\n\nnamespace utils "
  },
  {
    "path": "src/bin/chrome_fiddler.plugin/Contents/Info.plist",
    "chars": 1741,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "src/css/lib/bootstrap.css",
    "chars": 127358,
    "preview": "/*!\n * Bootstrap v2.3.2\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache"
  },
  {
    "path": "src/css/lib/fiddler.css",
    "chars": 106,
    "preview": "html,body{\n    width: 100%;\n    height: 100%;\n    overflow: hidden;\n}\n.icon.disabled{\n    opacity: 0.4;\n}\n"
  },
  {
    "path": "src/css/lib/shCoreDefault.css",
    "chars": 8704,
    "preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
  },
  {
    "path": "src/css/lib.css",
    "chars": 103,
    "preview": "@import url(\"lib/bootstrap.css\");\n@import url(\"lib/fiddler.css\");\n@import url(\"lib/shCoreDefault.css\");"
  },
  {
    "path": "src/css/page/options.css",
    "chars": 5285,
    "preview": ".table tr.disabled{\n    background: #eee;\n    color: #999;\n}\n\n#fiddler{\n    padding: 0 2px;\n}\nheader.navbar{\n    margin-"
  },
  {
    "path": "src/html/background.html",
    "chars": 226,
    "preview": "<!DOCTYPE html> \n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Fiddler</title"
  },
  {
    "path": "src/html/devtools.html",
    "chars": 290,
    "preview": "<!DOCTYPE html> \n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Fiddler</title"
  },
  {
    "path": "src/html/options.html",
    "chars": 13571,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Fiddler</title>"
  },
  {
    "path": "src/js/component/config.js",
    "chars": 1288,
    "preview": "var Fiddler_Config = function(){\n    \"use strict\";\n    var config = {\n        encoding: \"utf-8\",\n        enable_auto_res"
  },
  {
    "path": "src/js/component/event.js",
    "chars": 1767,
    "preview": "/**\n * 事件相关\n * @return {[type]} [description]\n */\nvar Fiddler_Event = function(){\n    \"use strict\";\n    function init(cl"
  },
  {
    "path": "src/js/component/file.js",
    "chars": 2535,
    "preview": "/**\n * 文件读取相关\n */\nvar Fiddler_File = function(){\n    \"use strict\";\n    /**\n     * [encodeText description]\n     * @param"
  },
  {
    "path": "src/js/component/resource.js",
    "chars": 6608,
    "preview": "/**\n * request resource\n * @return {[type]} [description]\n */\nvar Fiddler_Resource = function(){\n    \"use strict\";\n    v"
  },
  {
    "path": "src/js/component/rule.js",
    "chars": 11238,
    "preview": "/**\n * rule\n * @return {[type]} [description]\n */\nvar Fiddler_Rule = function(){\n    \"use strict\";\n    /**\n     * event "
  },
  {
    "path": "src/js/component.js",
    "chars": 459,
    "preview": "(function() {\n    var srcPath = '../js/';\n    document.write('<script src=\"' + srcPath + 'component/config.js\"><\\/script"
  },
  {
    "path": "src/js/lib/MimeTea.js",
    "chars": 21667,
    "preview": "/*!\n * MimeTea JavaScript Library v1.0.1\n * https://github.com/Rosario-Gueli/MimeTea.js\n *\n * Licence\n * https://github."
  },
  {
    "path": "src/js/lib/SyntaxHighlighter/shBrushCss.js",
    "chars": 5694,
    "preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
  },
  {
    "path": "src/js/lib/SyntaxHighlighter/shBrushJScript.js",
    "chars": 1649,
    "preview": "/**\n * SyntaxHighlighter\n * http://alexgorbatchev.com/SyntaxHighlighter\n *\n * SyntaxHighlighter is donationware. If you "
  },
  {
    "path": "src/js/lib/SyntaxHighlighter/shCore.js",
    "chars": 35336,
    "preview": "var XRegExp;\nif (XRegExp) throw Error(\"can't load XRegExp twice in the same frame\"); (function() {\n    function r(f, e) "
  },
  {
    "path": "src/js/lib/base64.js",
    "chars": 3840,
    "preview": "var Base64 = function() {  \n    // private property  \n    _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy"
  },
  {
    "path": "src/js/lib/beautify/beautify_css.js",
    "chars": 8067,
    "preview": "/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */\n/*\n\n  The MIT License (MIT)\n\n  Copyright (c) 2007-2013"
  },
  {
    "path": "src/js/lib/beautify/beautify_html.js",
    "chars": 34245,
    "preview": "/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */\n/*\n\n  The MIT License (MIT)\n\n  Copyright (c) 2007-2013"
  },
  {
    "path": "src/js/lib/beautify/beautify_js.js",
    "chars": 65076,
    "preview": "/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */\n/*\n\n  The MIT License (MIT)\n\n  Copyright (c) 2007-2013"
  },
  {
    "path": "src/js/lib/bootstrap.js",
    "chars": 61962,
    "preview": "/* ===================================================\n * bootstrap-transition.js v2.3.2\n * http://twitter.github.com/bo"
  },
  {
    "path": "src/js/lib/fiddler.js",
    "chars": 14311,
    "preview": "/**\n * base library\n * @return {[type]} [description]\n */\nvar Fiddler = function(){\n    var Fiddler = {};\n    Fiddler.is"
  },
  {
    "path": "src/js/lib/jquery.js",
    "chars": 339450,
    "preview": "/*!\n * jQuery JavaScript Library v1.10.2\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Co"
  },
  {
    "path": "src/js/lib/when.js",
    "chars": 28989,
    "preview": "/** @license MIT License (c) copyright 2011-2013 original author or authors */\n\n/**\n * A lightweight CommonJS Promises/A"
  },
  {
    "path": "src/js/lib.js",
    "chars": 1086,
    "preview": "(function() {\n    var srcPath = '../js/';\n    document.write('<script src=\"' + srcPath + 'lib/jquery.js\"><\\/script>');\n "
  },
  {
    "path": "src/js/page/background.js",
    "chars": 163,
    "preview": "chrome.browserAction.onClicked.addListener(function(){\n    var url = chrome.extension.getURL(\"html/options.html\");\n    w"
  },
  {
    "path": "src/js/page/devtools.js",
    "chars": 831,
    "preview": "var _initAdd = false;\nfunction addListener(){\n    if (_initAdd) {\n      return true;\n    };\n    _initAdd = true;\n    chr"
  },
  {
    "path": "src/js/page/options.js",
    "chars": 24111,
    "preview": "$(function(){\n    \"use strict\";\n    /**\n     * get item html\n     * @param  {[type]} data [description]\n     * @return {"
  },
  {
    "path": "src/manifest.json",
    "chars": 876,
    "preview": "{\n  \"manifest_version\": 2,\n  \"name\": \"Fiddler\",\n  \"version\": \"1.0.6\",\n  \"description\": \"Fiddler for chrome extension\",\n "
  },
  {
    "path": "test/css/base.css",
    "chars": 339,
    "preview": "*{\n    padding: 0;\n    margin: 0;\n}\n.div1, .div2, .div3{\n    width: 306px;\n    height: 97px;\n    background-color: red;\n"
  },
  {
    "path": "test/index.html",
    "chars": 205,
    "preview": "<html>\n<head>\n    <title></title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/base.css\" />\n</head>\n<body>\n<div "
  }
]

// ... and 13 more files (download for full content)

About this extraction

This page contains the full source code of the welefen/Fiddler GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 85 files (18.3 MB), approximately 236.8k tokens, and a symbol index with 332 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!