Comme this answer suggéré, je veux modifier un peu office.js
.Impossible de charger le bureau local.js
J'ai donc copié le contenu de https://appsforoffice.microsoft.com/lib/1/hosted/office.js
à local, de sorte que https://localhost:3000/static/office.js
montre bien le contenu.
Ensuite, je fais un fichier très simple test.html
:
<html>
<head>
<!--<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>-->
<script type="text/javascript" src="https://localhost:3000/static/office.js"></script>
</head>
<body>
haha
</body>
</html>
Chargement https://localhost:3000/static/test.html
avec office.js
à distance dans un navigateur affiche Warning: Office.js is loaded outside of Office client o15apptofilemappingtable.js:11
, et le charger dans un bureau add-in fonctionne bien. Toutefois, le chargement https://localhost:3000/static/test.html
avec office.js
local dans un navigateur affiche Uncaught SyntaxError: Unexpected token < o15apptofilemappingtable.js:1
et le chargement dans un complément Office donne une erreur Add-in Error Something went wrong and we couldn't start this add-in. Please try again later or contact your system administrator
.
Alors, est-ce que quelqu'un sait ce qui ne va pas ici? Est-il possible de faire notre propre version locale de office.js
?