I'm attempting to set up Pinned Site features for my project. The trouble is that I'd like to have the tasks be javascript actions rather than loading a new page. The reason for this is that the site is designed to only ever work in a single window.

I tried adding the following META tag:

<meta name="msapplication-task" content="name=Test Action;
        action-uri=javascript:ui('test',8);icon-uri=/img/icons/test.ico" />

However this causes the task to simply not appear. (Using a normal URL makes it show up just fine)

Is there any way to do this? The best I can think of is a hash and check for the hashchange event, but this doesn't work because it gets opened in a new tab of the window...

有帮助吗?

解决方案 2

This issue can be resolved by using a hash. By setting the action-uri to something readable by JavaScript, the JS can then read it, process the instruction, and then clear the hash in preparation for the next task.

This has the advantage that it works even when the window isn't already open, since the JS will read the hash on the first load too.

The catch is to add window-type=self to the content.

其他提示

I'm afraid this is not supported, because action list is designed for launching an application, not for a navigation inside it.

If you really want implement it, you can open a new window, send a message to server via web sockets and let server to forward that message to application window also via web sockets. But this is very hacky approach and works only in IE10.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top