DragonWar% 2015-05-02 08:13 采纳率: 0%
浏览 27

C#/。NET中的网站“主管”

I'm not sure what the technical name for what I'm looking for is, but this is what I'm trying to achieve:

I need to write a "client" for a specific website which uses Ajax/XHR for communication with the server.

My approach is to make a custom web browser that will run the JavaScript in the background, and I can show all the relevant information to the user. My first thought was to use hidden WebBrowser, however I'm not sure if it can achieve all the following:

  • Denying requests (so that unnecessary content doesn't load)
  • Inspecting (and possibly editing) XHR requests and responses
  • Making custom JavaScript calls (using javascript: quasi-protocol is ok)
  • Inspecting HTML elements' event listeners (so that I can call them)

Basically, I want functionality similar to that of Chrome's Developer Tools, in C#.

What's the easiest way of doing so, since my current idea is to use WebBrowser through a custom proxy, with hardcoded event listeners (manually found, hoping names don't change soon)?

  • 写回答

1条回答 默认 最新

  • weixin_33728708 2015-05-02 08:43
    关注

    If you truly want to use C# and Chrome, go for CefSharp:

    which is bindings for .NET and Chromium browser.

    I think it could be a lot easier to use Electron or nw.js, but these would require you code in javascript, which of cause also will make custom javascript calls easier.

    Side note: The new Visual Studio Code is actually built with Electron, so even microsoft uses that for doing javascript/web technology based apps.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂