Question

Well i couldn't find a answer for changing/setting custom http referer for awesomium in vb.net.

So can anyone help me out ?

Thank you very much.

Était-ce utile?

La solution

Implement the Awesomium.Core.IResourceInterceptor interface and attach it to your webcore session with WebCore.ResourceInterceptor = new ResourceInterceptor();

Here is a simple ResourceInterceptor in C#.

using System;
using System.IO;
using System.Reflection;
using Awesomium.Core;

namespace MyApp
{
    public class ResourceInterceptor : IResourceInterceptor
    {
        /// <summary>
        ///     Overwrites the HTTP_REFER request header
        /// </summary>
        public virtual ResourceResponse OnRequest(ResourceRequest request)
        {
          request.Referrer = "http://www.example.com;
        }

        /// <summary>
        ///     Optionally blocks any web browser requests by returning true
        /// </summary>
        public virtual bool OnFilterNavigation(NavigationRequest request)
        {
          return false;
        }
    }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top