This (experimental) extension allows any trusted site to receive settings from the GPII personalization framework.
Download the source code to a folder on your computer. You can either clone this repository or download a snapshot of master in a zip file.
In Google Chrome, go to 'Extensions', make sure that the 'Developer mode' checkbox is on, then click on 'Load unpacked extensions'. In the dialog box, select the folder where you downloaded the extension.
First, your website needs to be integrated with the GPII. More info
Note: If you are using the Flow Manager from GPII's review4 branch, you only need to integrate your solution into the web solutions registry. If you are using the master branch, you also need to include your solution into the desktop-specific registries (linux.json
, win32.json
or both) where you want to use the solution - until pull request 399 for JIRA ticket GPII-256 has been merged into the master branch.
The extension will only accept requests from trusted sites; for this you need to include your domain name into the extension's manifest.json.
"matches": ["*://*.example.com/*"]
Don't forget to reload the extension after applying this change.
Put this chunk of code somewhere in the source code of your site.
<script>
var extensionId = "bkoobcbgaajfpjhfkahlmghbeneedodc";
var solutionId = "my.example.com";
var port = chrome.runtime.connect(extensionId);
port.postMessage({type: "connectionRequest", solutionId: solutionId});
port.onMessage.addListener(function (msg) {
// At this point, the extension has accepted your connection request
if (msg.accepted) {
console.log("## got an okay from the extension side, now let's wait for settings ...");
}
// Whenever your settings change, you will be notified
if (msg.settings) {
console.log("## got new settings: " + JSON.stringify(msg.settings));
}
});
</script>
This may change in the future, so stay tuned ...
Any questions? Found a bug? File an issue.
Do you want to contribute with source code?
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Submit a pull request using Github