-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 1.3.0.0! Update CefShap and Ui, fix some bugs.
- Loading branch information
Showing
33 changed files
with
279 additions
and
4,537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "NacollectorFrontend"] | ||
path = NacollectorFrontend | ||
url = https://github.com/qwqcode/NacollectorFrontend |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using CefSharp; | ||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
|
||
public class ResourceSchemeHandler : ResourceHandler | ||
{ | ||
public override bool ProcessRequestAsync(IRequest request, ICallback callback) | ||
{ | ||
Uri u = new Uri(request.Url); | ||
String file = u.Authority + u.AbsolutePath; | ||
|
||
Assembly ass = Assembly.GetExecutingAssembly(); | ||
String resourcePath = ass.GetName().Name + "." + file.Replace("/", "."); | ||
|
||
Task.Run(() => | ||
{ | ||
using (callback) | ||
{ | ||
if (ass.GetManifestResourceInfo(resourcePath) != null) | ||
{ | ||
Stream stream = ass.GetManifestResourceStream(resourcePath); | ||
string mimeType = "application/octet-stream"; | ||
switch (Path.GetExtension(file)) | ||
{ | ||
case ".html": | ||
mimeType = "text/html"; | ||
break; | ||
case ".js": | ||
mimeType = "text/javascript"; | ||
break; | ||
case ".png": | ||
mimeType = "image/png"; | ||
break; | ||
case ".appcache": | ||
case ".manifest": | ||
mimeType = "text/cache-manifest"; | ||
break; | ||
} | ||
// Reset the stream position to 0 so the stream can be copied into the underlying unmanaged buffer | ||
stream.Position = 0; | ||
// Populate the response values - No longer need to implement GetResponseHeaders (unless you need to perform a redirect) | ||
ResponseLength = stream.Length; | ||
MimeType = mimeType; | ||
StatusCode = (int)HttpStatusCode.OK; | ||
Stream = stream; | ||
callback.Continue(); | ||
} | ||
else | ||
{ | ||
callback.Cancel(); | ||
} | ||
} | ||
}); | ||
|
||
return true; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Nacollector/Browser/Handler/ResourceSchemeHandlerFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using CefSharp; | ||
|
||
class ResourceSchemeHandlerFactory : ISchemeHandlerFactory | ||
{ | ||
public IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request) | ||
{ | ||
return new ResourceSchemeHandler(); | ||
} | ||
|
||
public static string SchemeName { get { return "resource"; } } | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.