I have troubles to create a blogger gadget that works with https. Currently I use the following code.
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="A Title" />
<Content type="html">
<![CDATA[
<p id="demo"></p>
<script type="text/javascript">
document.getElementById("demo").innerHTML = "Page hostname is " + window.location.hostname
</script>
]]>
</Content>
</Module>
When I add this gadget to my blog it shows only:
Gadget
This content is not yet available over encrypted connections.
I don't see why this should not work with https.
It seems to work in the preview.
Related
I've got the following HTML doc trying to transform some xml:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta charset="utf-8"/>
<script>
var rawXml = `<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song name="She loves you" artist="Beatles"/>
<song name="Yesterday" artist="Beatles "/>
<song name="Satisfaction" artist="Rolling Stones"/>
<song name="My Generation" artist="Who"/>
<song name="Under My Thumb" artist="Rolling Stones"/>
</songs>`;
var rawXsl = `<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<table>
<tr>
<th>Artist</th>
<th>Song list</th>
</tr>
<!-- <xsl:for-each select="songs/song"> -->
<!-- <tr> -->
<!-- <td><xsl:value-of select="#artist"/></td> -->
<!-- <td><xsl:value-of select="#name"/></td> -->
<!-- </tr> -->
<!-- </xsl:for-each> -->
<xsl:for-each-group select="songs/song" group-by="#artist">
<tr>
<td><xsl:value-of select="current-grouping-key()"/></td>
<td><xsl:value-of select="current-group()/#name" separator=","/></td>
</tr>
</xsl:for-each-group>
</table>
</xsl:template>
</xsl:stylesheet>`;
function parseXml(text)
{
var parser = new DOMParser();
var xml = parser.parseFromString(text, "application/xml");
return xml;
}
function displayContent()
{
var xml = parseXml(rawXml);
var xsl = parseXml(rawXsl);
var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
var resultDocument = xsltProcessor.transformToFragment(xml, document);
var target = document.getElementById("contentTarget");
target.appendChild(resultDocument);
}
</script>
</head>
<body onload="displayContent()">
<div id="contentTarget"></div>
</body>
</html>
So in firefox I get said error 0x80600004 (NS_ERROR_XSLT_EXECUTION_FAILURE) and TBH, I have no idea why. I also tried it in Edge Chromium, there I just see the table header and apparently execution stops when trying to group, but I'm not able to make edge report any error.
If you comment in the xsl:for-each and comment out xsl:for-each-group, it works perfectly fine.
What am I doing wrong, when trying to group?
The answer is simple:
ALL Browsers (unfortunately) only support XSLT-1.0. But the for-each-group instruction is part of XSLT-2.0. So if you use it, the stylesheet will not work (See Grouping With XSLT 2.0).
Solution:
Stick to XSLT-1.0 instructions and complain vigorously to the browser creators.
We're currently developing a PowerPoint add-in and we have trouble making it work in Slide Show (fullscreen) in PowerPoint Online, which recently caused it to be rejected from the Office Store.
Here is a minimal example which reproduces the bug, based on the How-To guide:
index.html
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -->
<!-- See LICENSE in the project root for license information -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Office Add-in</title>
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js"></script>
<!-- LOCAL -->
<link rel="stylesheet" href="node_modules/office-ui-fabric-js/dist/css/fabric.min.css" />
</head>
<body class="ms-font-m ms-welcome">
<h1>Hello World</h1>
<script type="text/javascript" src="node_modules/core-js/client/core.js"></script>
<script type="text/javascript" src="node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="node_modules/office-ui-fabric-js/dist/js/fabric.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
app.js
"use strict";
(function() {
// The initialize function must be run each time a new page is loaded
Office.initialize = function(reason) {
$(document).ready(function() {
$("#run").click(run);
});
};
function run() {
return PowerPoint.run(function(context) {
/**
* Insert your PowerPoint code here
*/
return context.sync();
});
}
})();
counter-manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="ContentApp">
<Id>71a1a0ed-6cd0-4a6e-ad2d-015b8a8b43cb</Id>
<Version>1.0.0.0</Version>
<ProviderName>Test</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="DisplayName" />
<Description DefaultValue="Description"/>
<IconUrl DefaultValue="https://localhost:3004/assets/icon-32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3004/assets/hi-res-icon.png"/>
<AppDomains></AppDomains>
<Hosts>
<Host Name="Presentation" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3004/index.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides
xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Presentation"></Host>
</Hosts>
<Resources></Resources>
</VersionOverrides>
</OfficeApp>
We're serving our add-in using Browsersync as explained in the How-To guide. When I add it to a blank presentation in PowerPoint Online, it seems to work as expected (except for a different bug when refreshing described here) until I try to go into Slide Show (fullscreen) mode. I see a loading animation in fullscreen for a few seconds then I'm back to the previous editor mode.
Here are the errors displayed in the Chrome Developer Tools Console when trying to enter SlideShow mode:
Refused to get unsafe header "X-WacCluster"
Refused to get unsafe header "X-SupportSVGInWebGL"
Failed to load https://euc-powerpoint.officeapps.live.com/pods/RemoteUls.ashx: The 'Access-Control-Allow-Origin' header contains multiple values 'https://contentstorage.osi.office.net, https://contentstorage.osi.office.net', but only one is allowed. Origin 'https://contentstorage.osi.office.net' is therefore not allowed access.
Uncaught TypeError: Cannot read property '$37' of null
at PPTe.$22.$17a (VM3959 11b10a4995dd8c5f.js:10)
How can we ensure that our add-in works correctly in Slide Show mode?
I have a pom module where I define a site file descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<project name="${project.name}" xmlns="http://maven.apache.org/DECORATION/1.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd">
<body>
<head>
<script type="text/javascript" src="http://common.nuiton.org/dev/js/pom-site.js">
</script>
</head>
</body>
</project>
Now I have a child maven module of the first module with this site descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<project name="${project.name}" xmlns="http://maven.apache.org/DECORATION/1.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd">
<body>
<head>
$(document).ready(function () {
$('#mavenProjectProperties).attr('scmwebeditor_vmFiles', ',install,update,usage,configure,');
}
</script>
</head>
</body>
</project>
when generating the child site, I got a strange html code:
<script id="myscript" src="http://common.nuiton.org/dev/js/pom-site.js" type="text/javascript">$(document).ready(function () {
$('#mavenProjectProperties).attr('scmwebeditor_vmFiles', ',install,update,usage,configure,');
}</script>
How can I make this working ? I will probably open an issue
I want to display an array of images in my sidebar. The images should be clickable. This is what I got so far in my ff-sidebar.xul file but nothing is shown:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type"text/css" ?>
<!DOCTYPE page SYSTEM "chrome://pos/locale/overlay.dtd">
<page id="posSidebar" title="&posSidebar.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="ff-sidebar.js"/>
<script src="ff-sidebar.css"/>
<vbox flex="1">
<label value="&posSidebar.label;" />
<image id="image1"/>
</vbox>
</page>
and the code of the css file:
#image1
{
list-style-image: url("chrome://myextension/skin/images/1.png" width='135' height='130');
}
Why are you trying to load in your CSS file as a script? also the script declarations should be like this:
<script type="application/x-javascript" src="chrome://rehostimage/content/password_manager.js" />
As for the images showing up, have you tried
<image src="chrome://myextension/skin/images/1.png" />
?
I want to create an image in my statusbar, but why it can't appear?
And, how to add menu in status bar when I click right the mouse?
This is my script:
<?xml version="1.0"?>
<!--
# Fungsi dari file ini adalah mengatur tampilan dan perilaku addon.
# Membuat menu "search hadits" pada saat user klik kanan pada halaman browser atau
# pada saat user klik kanan pada kata di halaman browser.
-->
<overlay id="inline_trans"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--
# Membuat Menu Klik kanan pada halaman firefox.
# Memanggil fungsi pada haditsSearch.js untuk mulai melakukan pencarian hadits.
-->
<popup id="contentAreaContextMenu">
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
<!-- ======================================================== -->
<!--
<window id="main-window">
<popupset id="mainPopupSet"></popupset>
<vbox id="hadits_holder" />
</window>
-->
<!--
<spacer flex="1"/>
<progressmeter mode="determined" value="82"/>
-->
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans"
src="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="indonesia inline translator"
context="indonesia inline translator menu"
onclick="alert('okeh cuy')"
tooltiptext="inlinetrans versi 1.0"
/>
</statusbar>
</overlay>
You need an <image>. Something like:
<statusbar id="status-bar">
<statusbarpanel id="status-bar-inlinetrans">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
</statusbarpanel>
</statusbar>
The other attributes can probably go on either the image or the statusbarpanel.