在Alfresco 5.0

时间:2016-08-19 15:23:25

标签: javascript alfresco alfresco-share

我一直在尝试加载自定义的javascript,以便在我的所有露天页面中加载。

我需要添加一个监听器,因此外部应用程序可以使用iframe访问在alfresco加载的当前url。

听众会是这样的:(从this question复制)

window.addEventListener('message', function(event) {

    // IMPORTANT: Check the origin of the data!
    if (~event.origin.indexOf('http://yoursite.com')) {
        // The data has been sent from your site

        // The data sent with postMessage is stored in event.data
        console.log(event.data);
    } else {
        // The data hasn't been sent from your site!
        // Be careful! Do not use it.
        return;
    }
});

它可以附加在每个页面上,也可以作为外部.js文件加载。

感谢您的时间。

1 个答案:

答案 0 :(得分:1)

首先,查看Alfresco documentation

对于目标,您可以选择页脚或标题区域。

然后在您的扩展中,将您的js文件包含在@script标记中。

相关问题