Skip to content

Instantly share code, notes, and snippets.

@mindspank
mindspank / embedsheet.js
Last active January 17, 2022 05:16
Emulate a Qlik Sense sheet using the Capabilities API
var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 );
var config = {
host: window.location.hostname,
prefix: prefix,
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
} );