Skip to content

Commit

Permalink
Add IBrowserResources interface
Browse files Browse the repository at this point in the history
IBrowserInterface allows to inject user's JavaScript and CSS code to
WebKit.
  • Loading branch information
marcin-mielczarczyk-red committed Jul 8, 2021
1 parent 4899963 commit cccdfaa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions interfaces/IBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#pragma once
#include "Module.h"

// @stubgen:include <com/IRPCIterator.h>

namespace WPEFramework {
namespace Exchange {

Expand Down Expand Up @@ -149,5 +151,31 @@ namespace Exchange {
virtual uint32_t CollectGarbage() = 0;
};

/* @json */
struct EXTERNAL IBrowserResources : virtual public Core::IUnknown {

enum { ID = ID_BROWSER_RESOURCES };

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

// @property
// @brief Headers to send on all requests that the browser makes
// @param header Header Name
virtual uint32_t Headers(IStringIterator*& header /* @out */) const = 0;
virtual uint32_t Headers(IStringIterator* const header) = 0;

// @property
// @brief User scripts used by the browser
// @param uris JSON array containing URIs pointing to user scripts, supported protocols: file://
virtual uint32_t UserScripts(IStringIterator*& uris /* @out */) const = 0;
virtual uint32_t UserScripts(IStringIterator* const uris) = 0;

// @property
// @brief User style sheets used by the browser
// @param uris JSON array containing URIs pointing to user style sheets, supported protocols: file://
virtual uint32_t UserStyleSheets(IStringIterator*& uris /* @out */) const = 0;
virtual uint32_t UserStyleSheets(IStringIterator* const uris) = 0;
};

}
}
1 change: 1 addition & 0 deletions interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ namespace Exchange {
ID_REMOTEINVOCATION,

ID_WEB_BROWSER,
ID_BROWSER_RESOURCES,

ID_AVSCLIENT,
ID_AVSCONTROLLER,
Expand Down

0 comments on commit cccdfaa

Please sign in to comment.