Skip to content

Commit

Permalink
squash to 1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TkYu committed May 20, 2020
1 parent 50786f6 commit 39af0e2
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 75 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# Ignore VC-LTL
VC-LTL

# User-specific files
*.suo
*.user
Expand Down
9 changes: 3 additions & 6 deletions Shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ VC-LTL默认搜索顺序

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>

<!--如果本地工程没有,那么继续尝试通过注册表获取VC-LTL路径,双击Install.cmd可以自动产生此注册表。-->
<VC_LTL_Root Condition=" '$(VC_LTL_Root)'=='' ">$(Registry:HKEY_CURRENT_USER\Code\VC-LTL@Root)</VC_LTL_Root>

<!--当前项目根目录存在VC-LTL?-->
<VC_LTL_Root Condition=" ('$(VC_LTL_Root)'=='') And (Exists('$(ProjectDir)VC-LTL\_msvcrt.h')) ">$(ProjectDir)VC-LTL</VC_LTL_Root>

Expand All @@ -42,13 +38,14 @@ VC-LTL默认搜索顺序
<!--当前解决方案父目录存在VC-LTL?-->
<VC_LTL_Root Condition=" ('$(VC_LTL_Root)'=='') And ('$(SolutionDir)'!='') And (Exists('$(SolutionDir)..\VC-LTL\_msvcrt.h')) ">$(SolutionDir)..\VC-LTL</VC_LTL_Root>


<!--如果本地工程没有,那么继续尝试通过注册表获取VC-LTL路径,双击Install.cmd可以自动产生此注册表。-->
<VC_LTL_Root Condition=" '$(VC_LTL_Root)'=='' ">$(Registry:HKEY_CURRENT_USER\Code\VC-LTL@Root)</VC_LTL_Root>

<!--取消下方注释可以开启VC-LTL轻量模式,轻量模式更加注重体积控制,但是CRT规范将会维持在VS2008。如果你需要高度兼容微软UCRT,那么请不要打开此选项!!!-->
<!--<DisableAdvancedSupport>true</DisableAdvancedSupport>-->

<!--取消下方注释可以开启强制XP兼容模式,默认情况下仅在选择WinXP工具集时才开启。-->
<SupportWinXP>true</SupportWinXP>
<!--<SupportWinXP>true</SupportWinXP>-->
</PropertyGroup>

<ImportGroup Label="PropertySheets">
Expand Down
13 changes: 4 additions & 9 deletions firedoge.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -174,16 +174,11 @@
<ClInclude Include="src\Bosskey.h" />
<ClInclude Include="src\CustomCommand.h" />
<ClInclude Include="src\FastSearch.h" />
<ClInclude Include="src\GetParent.h" />
<ClInclude Include="src\GreenChrome.h" />
<ClInclude Include="src\FireDoge.h" />
<ClInclude Include="src\hijack.h" />
<ClInclude Include="src\hosts.h" />
<ClInclude Include="src\http.h" />
<ClInclude Include="src\Loader.h" />
<ClInclude Include="src\ModifyLnk.h" />
<ClInclude Include="src\PakFile.h" />
<ClInclude Include="src\Parsekeys.h" />
<ClInclude Include="src\PatchResourcesPak.h" />
<ClInclude Include="src\Patchs.h" />
<ClInclude Include="src\SettingWeb.h" />
<ClInclude Include="src\SharedConfig.h" />
Expand All @@ -199,7 +194,7 @@
<ClCompile Include="3rd\minhook\src\trampoline.c" />
<ClCompile Include="3rd\mini_gzip\miniz.c" />
<ClCompile Include="3rd\mongoose\mongoose.c" />
<ClCompile Include="src\GreenChrome.cpp" />
<ClCompile Include="src\FireDoge.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\FireDoge.rc" />
Expand Down
19 changes: 2 additions & 17 deletions firedoge.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,21 @@
<ClInclude Include="src\FastSearch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\GetParent.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\GreenChrome.h">
<ClInclude Include="src\FireDoge.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\hijack.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\hosts.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\http.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\Loader.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\ModifyLnk.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\PakFile.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\Parsekeys.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\PatchResourcesPak.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\Patchs.h">
<Filter>头文件</Filter>
</ClInclude>
Expand Down Expand Up @@ -101,7 +86,7 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\GreenChrome.cpp">
<ClCompile Include="src\FireDoge.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="3rd\cjson\cJSON.c">
Expand Down
Binary file modified res/FireDoge.rc
Binary file not shown.
12 changes: 12 additions & 0 deletions src/CustomCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ std::wstring GetCommand(const wchar_t *iniPath, LPWSTR commandLine)
if(i==0) //在进程路径后面追加参数
{
command_line.push_back(L"-with-firedoge");
/*
// 如果需要修改新标签空白,还需要添加一个命令,否则使用的是在线版
if(BlankNewTab)
{
command_line.push_back(L"--force-local-ntp");
}
if (RemoveDevelopError)
{
command_line.push_back(L"--enable-automation");
command_line.push_back(L"--disable-infobars");
}
*/

auto contents = GetSection(L"AppendParams", iniPath);
for (auto &parameter_str : contents)
Expand Down
8 changes: 4 additions & 4 deletions src/GreenChrome.cpp → src/FireDoge.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "GreenChrome.h"
#include "FireDoge.h"

void GreenChrome(LPWSTR command_line)
void FireDoge(LPWSTR command_line)
{
// exe路径
wchar_t exePath[MAX_PATH];
Expand All @@ -18,7 +18,7 @@ void GreenChrome(LPWSTR command_line)
// 读取配置
ReadConfig(iniPath);

// 父进程不是Firefox,则需要启动追加参数功能
// 父进程不是FF的话,则需要启动追加参数功能
// bool with_firedoge = wcsstr(command_line, L"-with-firedoge") != 0;
// if (!with_firedoge)
// {
Expand All @@ -37,7 +37,7 @@ void GreenChrome(LPWSTR command_line)
//{
// DebugLog(L"子进程启动,id %ld", ::GetCurrentProcessId());
//}
// 打造便携版chrome
// 打造便携
MakePortable(iniPath);

// 标签页,书签,地址栏增强
Expand Down
2 changes: 1 addition & 1 deletion src/GreenChrome.h → src/FireDoge.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef uint64_t MWORD;
typedef uint32_t MWORD;
#endif

void GreenChrome(LPWSTR command_line);
void FireDoge(LPWSTR command_line);

HMODULE hInstance;

Expand Down
11 changes: 6 additions & 5 deletions src/Loader.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

typedef int (*Startup) ();
Startup ChromeMain = NULL;
Startup FirefoxMain = NULL;

//
int Loader()
{
LPWSTR command_line = GetCommandLineW();
//DebugLog(L"Loader %s", command_line);
GreenChrome(command_line);

//返回到Chrome
return ChromeMain();
FireDoge(command_line);

//返回到FF
return FirefoxMain();
}

void InstallLoader()
Expand All @@ -21,7 +22,7 @@ void InstallLoader()
PBYTE entry = (PBYTE)mi.EntryPoint;

// 入口点跳转到Loader
MH_STATUS status = MH_CreateHook(entry, Loader, (LPVOID*)&ChromeMain);
MH_STATUS status = MH_CreateHook(entry, Loader, (LPVOID*)&FirefoxMain);
if (status == MH_OK)
{
MH_EnableHook(entry);
Expand Down
4 changes: 0 additions & 4 deletions src/Patchs.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ void init_global_env(const wchar_t *iniPath)
{
//wcscpy(localdata_path, iniPath);
//PathRemoveFileSpecW(localdata_path);
////wcscat(localdata_path, L"\\LocalAppData");
//wcscat(localdata_path, L"\\");
//wcscat(localdata_path, profileFolder);
//wcscat(localdata_path, L"\\Cache");
wcscpy(localdata_path, appdata_path);
wcscat(localdata_path, L"\\Cache");
//DebugLog(L"localdata_path = %s", localdata_path);
Expand Down
24 changes: 24 additions & 0 deletions src/SharedConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ bool DoubleClickCloseTab = false;
bool RightClickCloseTab = false;
bool HoverActivateTab = false;
int HoverTime = HOVER_DEFAULT;
// bool KeepLastTab = false;
bool HoverTabSwitch = false;
bool RightTabSwitch = false;
// bool BookMarkNewTab = false;
// bool OpenUrlNewTab = false;
// bool NotBlankTab = false;
// bool FrontNewTab = false;
// bool HandleMenu = false;
int DPI = 100;

bool MouseGesture = false;
int Sensitive = 50;

// bool BlankNewTab = false;
// bool RemoveUpdateError = false;
// bool RemoveDevelopError = false;
bool StopWeb = false;

bool AddGestureFlag = false;
Expand All @@ -26,6 +35,8 @@ bool KeyRepeat = false;
bool KeyIgnoreEdit = false;
bool DebugKeyPress = false;

// bool HostsSwitch = false;
// wchar_t hosts_file[MAX_PATH] = {0};

int ACP = 0;

Expand All @@ -46,16 +57,29 @@ void ReadConfig(const wchar_t *iniPath)
RightClickCloseTab = GetPrivateProfileInt(L"UIEnhancements", L"CloseTabByRightClick", 0, iniPath) == 1;
HoverActivateTab = GetPrivateProfileInt(L"UIEnhancements", L"ActivateTabByHover", 0, iniPath) == 1;
HoverTime = GetPrivateProfileInt(L"UIEnhancements", L"HoverDelay", HOVER_DEFAULT, iniPath);
// KeepLastTab = GetPrivateProfileInt(L"UIEnhancements", L"KeepLastTab", 1, iniPath) == 1;
HoverTabSwitch = GetPrivateProfileInt(L"UIEnhancements", L"SwitchTabByHover", 1, iniPath) == 1;
RightTabSwitch = GetPrivateProfileInt(L"UIEnhancements", L"SwitchTabByHoldRightButton", 1, iniPath) == 1;
//BookMarkNewTab = GetPrivateProfileInt(L"UIEnhancements", L"新标签打开书签", 1, iniPath) == 1;
//OpenUrlNewTab = GetPrivateProfileInt(L"UIEnhancements", L"新标签打开网址", 0, iniPath) == 1;
//NotBlankTab = GetPrivateProfileInt(L"UIEnhancements", L"新标签页不生效", 1, iniPath) == 1;
//FrontNewTab = GetPrivateProfileInt(L"UIEnhancements", L"前台打开新标签", 1, iniPath) == 1;
//HandleMenu = GetPrivateProfileInt(L"UIEnhancements", L"处理弹出菜单", 1, iniPath) == 1;
DPI = GetPrivateProfileInt(L"UIEnhancements", L"DPI", 100, iniPath);

MouseGesture = GetPrivateProfileInt(L"Gesture", L"Enabled", 1, iniPath) == 1;
Sensitive = GetPrivateProfileInt(L"Gesture", L"Threshold", 50, iniPath);

//BlankNewTab = GetPrivateProfileIntW(L"General", L"空白新标签页面", 0, iniPath) == 1;
//RemoveUpdateError = GetPrivateProfileIntW(L"General", L"移除更新错误", 0, iniPath) == 1;
//RemoveDevelopError = GetPrivateProfileIntW(L"General", L"移除开发者模式警告", 0, iniPath) == 1;
StopWeb = GetPrivateProfileInt(L"General", L"WebUIDisabled", 0, iniPath) == 1;

KeyTransform = GetPrivateProfileInt(L"KeyTransformation", L"Enabled", 0, iniPath) == 1;
KeyRepeat = GetPrivateProfileInt(L"KeyTransformation", L"DuplicateKeyAccepted", 1, iniPath) == 1;
KeyIgnoreEdit = GetPrivateProfileInt(L"KeyTransformation", L"IgnoreAtEditBox", 1, iniPath) == 1;
DebugKeyPress = GetPrivateProfileInt(L"KeyTransformation", L"Debug", 0, iniPath) == 1;

//HostsSwitch = GetPrivateProfileIntW(L"hosts", L"Enabled", 1, iniPath) == 1;
//GetPrivateProfileStringW(L"hosts", L"保存位置", L"%appdata%\\gc-hosts.txt", hosts_file, MAX_PATH, iniPath);
}
29 changes: 0 additions & 29 deletions src/TabBookmark.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@


/*
chrome ui tree
browser/ui/views/frame/BrowserRootView
ui/views/window/NonClientView
BrowserView
TopContainerView
TabStrip
Tab
TabCloseButton
ImageButton
ToolbarView
LocationBarView
OmniboxViewViews
BookmarkBarView
BookmarkButton
*/

std::wstring GetName(__in CComPtr<IAccessible> pAcc, __in CComVariant varChild = CHILDID_SELF)
{
if (!pAcc)
Expand Down Expand Up @@ -1153,15 +1133,6 @@ LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
// bookmark_new_tab = true;
// }
// }
//if (wParam == WM_LBUTTONUP && BookMarkNewTab && HandleMenu && !IsPressed(VK_CONTROL))
//{
// HWND hwnd = WindowFromPoint(pmouse->pt);
// wchar_t name[MAX_PATH];
// if (GetClassName(hwnd, name, MAX_PATH) && wcscmp(name, L"Chrome_WidgetWin_2") == 0)
// {
// menu_bookmark_new_tab = true;
// }
//}

if(TopContainerView)
{
Expand Down

0 comments on commit 39af0e2

Please sign in to comment.