You've already forked CEF4Delphi
							
							
				mirror of
				https://github.com/salvadordf/CEF4Delphi.git
				synced 2025-10-30 23:07:52 +02:00 
			
		
		
		
	Now relative paths in GlobalCEFApp properties are converted to absolute paths automatically
This commit is contained in:
		| @@ -168,6 +168,9 @@ type | |||||||
|       FOnCDMRegistrationComplete     : TOnCDMRegistrationCompleteEvent; |       FOnCDMRegistrationComplete     : TOnCDMRegistrationCompleteEvent; | ||||||
|  |  | ||||||
|       procedure SetCache(const aValue : ustring); |       procedure SetCache(const aValue : ustring); | ||||||
|  |       procedure SetCookies(const aValue : ustring); | ||||||
|  |       procedure SetUserDataPath(const aValue : ustring); | ||||||
|  |       procedure SetBrowserSubprocessPath(const aValue : ustring); | ||||||
|       procedure SetFrameworkDirPath(const aValue : ustring); |       procedure SetFrameworkDirPath(const aValue : ustring); | ||||||
|       procedure SetResourcesDirPath(const aValue : ustring); |       procedure SetResourcesDirPath(const aValue : ustring); | ||||||
|       procedure SetLocalesDirPath(const aValue : ustring); |       procedure SetLocalesDirPath(const aValue : ustring); | ||||||
| @@ -276,13 +279,13 @@ type | |||||||
|       procedure   Internal_OnCDMRegistrationComplete(result : TCefCDMRegistrationError; const error_message : ustring); |       procedure   Internal_OnCDMRegistrationComplete(result : TCefCDMRegistrationError; const error_message : ustring); | ||||||
|  |  | ||||||
|       property Cache                             : ustring                             read FCache                             write SetCache; |       property Cache                             : ustring                             read FCache                             write SetCache; | ||||||
|       property Cookies                           : ustring                             read FCookies                           write FCookies; |       property Cookies                           : ustring                             read FCookies                           write SetCookies; | ||||||
|       property UserDataPath                      : ustring                             read FUserDataPath                      write FUserDataPath; |       property UserDataPath                      : ustring                             read FUserDataPath                      write SetUserDataPath; | ||||||
|       property UserAgent                         : ustring                             read FUserAgent                         write FUserAgent; |       property UserAgent                         : ustring                             read FUserAgent                         write FUserAgent; | ||||||
|       property ProductVersion                    : ustring                             read FProductVersion                    write FProductVersion; |       property ProductVersion                    : ustring                             read FProductVersion                    write FProductVersion; | ||||||
|       property Locale                            : ustring                             read FLocale                            write FLocale; |       property Locale                            : ustring                             read FLocale                            write FLocale; | ||||||
|       property LogFile                           : ustring                             read FLogFile                           write FLogFile; |       property LogFile                           : ustring                             read FLogFile                           write FLogFile; | ||||||
|       property BrowserSubprocessPath             : ustring                             read FBrowserSubprocessPath             write FBrowserSubprocessPath; |       property BrowserSubprocessPath             : ustring                             read FBrowserSubprocessPath             write SetBrowserSubprocessPath; | ||||||
|       property FrameworkDirPath                  : ustring                             read FFrameworkDirPath                  write SetFrameworkDirPath; |       property FrameworkDirPath                  : ustring                             read FFrameworkDirPath                  write SetFrameworkDirPath; | ||||||
|       property LogSeverity                       : TCefLogSeverity                     read FLogSeverity                       write FLogSeverity; |       property LogSeverity                       : TCefLogSeverity                     read FLogSeverity                       write FLogSeverity; | ||||||
|       property JavaScriptFlags                   : ustring                             read FJavaScriptFlags                   write FJavaScriptFlags; |       property JavaScriptFlags                   : ustring                             read FJavaScriptFlags                   write FJavaScriptFlags; | ||||||
| @@ -607,18 +610,80 @@ end; | |||||||
|  |  | ||||||
| procedure TCefApplication.SetCache(const aValue : ustring); | procedure TCefApplication.SetCache(const aValue : ustring); | ||||||
| begin | begin | ||||||
|   FCache           := trim(aValue); |   if (length(aValue) > 0) then | ||||||
|  |     begin | ||||||
|  |       if CustomPathIsRelative(aValue) then | ||||||
|  |         FCache := GetModulePath + aValue | ||||||
|  |        else | ||||||
|  |         FCache := aValue; | ||||||
|  |     end | ||||||
|  |    else | ||||||
|  |     FCache := ''; | ||||||
|  |  | ||||||
|   FDisableGPUCache := (length(FCache) = 0); |   FDisableGPUCache := (length(FCache) = 0); | ||||||
| end; | end; | ||||||
|  |  | ||||||
| procedure TCefApplication.SetFrameworkDirPath(const aValue : ustring); | procedure TCefApplication.SetCookies(const aValue : ustring); | ||||||
| begin | begin | ||||||
|   if (length(aValue) > 0) and DirectoryExists(aValue) then |   if (length(aValue) > 0) then | ||||||
|     begin |     begin | ||||||
|       if CustomPathIsRelative(aValue) then |       if CustomPathIsRelative(aValue) then | ||||||
|         FFrameworkDirPath := GetModulePath + aValue |         FCookies := GetModulePath + aValue | ||||||
|        else |        else | ||||||
|         FFrameworkDirPath := aValue; |         FCookies := aValue; | ||||||
|  |     end | ||||||
|  |    else | ||||||
|  |     FCookies := ''; | ||||||
|  | end; | ||||||
|  |  | ||||||
|  | procedure TCefApplication.SetUserDataPath(const aValue : ustring); | ||||||
|  | begin | ||||||
|  |   if (length(aValue) > 0) then | ||||||
|  |     begin | ||||||
|  |       if CustomPathIsRelative(aValue) then | ||||||
|  |         FUserDataPath := GetModulePath + aValue | ||||||
|  |        else | ||||||
|  |         FUserDataPath := aValue; | ||||||
|  |     end | ||||||
|  |    else | ||||||
|  |     FUserDataPath := ''; | ||||||
|  | end; | ||||||
|  |  | ||||||
|  | procedure TCefApplication.SetBrowserSubprocessPath(const aValue : ustring); | ||||||
|  | var | ||||||
|  |   TempPath : string; | ||||||
|  | begin | ||||||
|  |   if (length(aValue) > 0) then | ||||||
|  |     begin | ||||||
|  |       if CustomPathIsRelative(aValue) then | ||||||
|  |         TempPath := GetModulePath + aValue | ||||||
|  |        else | ||||||
|  |         TempPath := aValue; | ||||||
|  |  | ||||||
|  |       if FileExists(TempPath) then | ||||||
|  |         FBrowserSubprocessPath := TempPath | ||||||
|  |        else | ||||||
|  |         FBrowserSubprocessPath := ''; | ||||||
|  |     end | ||||||
|  |    else | ||||||
|  |     FBrowserSubprocessPath := ''; | ||||||
|  | end; | ||||||
|  |  | ||||||
|  | procedure TCefApplication.SetFrameworkDirPath(const aValue : ustring); | ||||||
|  | var | ||||||
|  |   TempPath : string; | ||||||
|  | begin | ||||||
|  |   if (length(aValue) > 0) then | ||||||
|  |     begin | ||||||
|  |       if CustomPathIsRelative(aValue) then | ||||||
|  |         TempPath := GetModulePath + aValue | ||||||
|  |        else | ||||||
|  |         TempPath := aValue; | ||||||
|  |  | ||||||
|  |       if DirectoryExists(TempPath) then | ||||||
|  |         FFrameworkDirPath := TempPath | ||||||
|  |        else | ||||||
|  |         FFrameworkDirPath := ''; | ||||||
|     end |     end | ||||||
|    else |    else | ||||||
|     FFrameworkDirPath := ''; |     FFrameworkDirPath := ''; | ||||||
| @@ -627,26 +692,40 @@ begin | |||||||
| end; | end; | ||||||
|  |  | ||||||
| procedure TCefApplication.SetResourcesDirPath(const aValue : ustring); | procedure TCefApplication.SetResourcesDirPath(const aValue : ustring); | ||||||
|  | var | ||||||
|  |   TempPath : string; | ||||||
| begin | begin | ||||||
|   if (length(aValue) > 0) and DirectoryExists(aValue) then |   if (length(aValue) > 0) then | ||||||
|     begin |     begin | ||||||
|       if CustomPathIsRelative(aValue) then |       if CustomPathIsRelative(aValue) then | ||||||
|         FResourcesDirPath := GetModulePath + aValue |         TempPath := GetModulePath + aValue | ||||||
|        else |        else | ||||||
|         FResourcesDirPath := aValue; |         TempPath := aValue; | ||||||
|  |  | ||||||
|  |       if DirectoryExists(TempPath) then | ||||||
|  |         FResourcesDirPath := TempPath | ||||||
|  |        else | ||||||
|  |         FResourcesDirPath := ''; | ||||||
|     end |     end | ||||||
|    else |    else | ||||||
|     FResourcesDirPath := ''; |     FResourcesDirPath := ''; | ||||||
| end; | end; | ||||||
|  |  | ||||||
| procedure TCefApplication.SetLocalesDirPath(const aValue : ustring); | procedure TCefApplication.SetLocalesDirPath(const aValue : ustring); | ||||||
|  | var | ||||||
|  |   TempPath : string; | ||||||
| begin | begin | ||||||
|   if (length(aValue) > 0) and DirectoryExists(aValue) then |   if (length(aValue) > 0) then | ||||||
|     begin |     begin | ||||||
|       if CustomPathIsRelative(aValue) then |       if CustomPathIsRelative(aValue) then | ||||||
|         FLocalesDirPath := GetModulePath + aValue |         TempPath := GetModulePath + aValue | ||||||
|        else |        else | ||||||
|         FLocalesDirPath := aValue; |         TempPath := aValue; | ||||||
|  |  | ||||||
|  |       if DirectoryExists(TempPath) then | ||||||
|  |         FLocalesDirPath := TempPath | ||||||
|  |        else | ||||||
|  |         FLocalesDirPath := ''; | ||||||
|     end |     end | ||||||
|    else |    else | ||||||
|     FLocalesDirPath := ''; |     FLocalesDirPath := ''; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user