none
Will Javascript injection into Office 365, will it affect masterpage updates in future RRS feed

  • Question

  • Hi Team,

    If i am injecting JavaScript or JQurey  to Office 365 site will it affect master page updates in future?

    ex: if I inject JS, Jquery or Html files to Office 365 site. After that am i able to get updates from Microsoft.

    Please suggest the best approach to add custom functionality to Office 365 site without Customize/Editing  the Master Page.

     Thanks in Advance.


    Friday, December 9, 2016 5:52 AM

Answers

  • Hi,

    on Office 365 is definitely a best practice don't touch the Master Page, if you want to customize your site I suggest to use the embed Javascript approach, there is a good solution here how to do that:

    https://github.com/SharePoint/PnP/tree/master/Samples/Core.EmbedJavaScript

    Basically you can add a javascript file to your site like a custom action, this means that for every load of any page of your site, SharePoint run your javascript file as if that is referenced in the masterpage, but with this technique you do not modify it.

    In the sample has been used a SharePoint Provider hosted app but you can do it even with a console application, thanks to CSOM.

    Kind regards


    Giuliano De Luca - MCSD SharePoint, MCSD Web Applications, MCPS, MS. www.delucagiuliano.com Twitter: @giuleon Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Friday, December 9, 2016 11:37 PM

All replies

  • Hello Manojgarapati,

    I believe you cannot inject any JS code for O365 accounts. Yes, you will be able to mess with OWA code on premises. From this statement I  would assume you are asking about custom injection of your own JS code into code of OWA of an Exchange on premises. In this case the answer on your question is .... you will be loosing your changes on every upgrade of Exchange software, indeed. And as minimum you would need to re-apply your changes into the new OWA website (during upgrade you will see the new subfolder with new version) and as the maximum your code will not work any longer and you would need to investigate what was changed and fix your custom code. 

    I would not take this approach as the OWA is the "hot" product and gets upgrades very often. Also with injection type of customization you will be limited to on prem Exchanges only (as far as I aware). Also you may compromise security of the OWA without knowing it and the last, but not least you would need to verify all sorts of scenarios, do your own QA after every Exchange upgrade.

    To help customize O365 Microsoft introduced all sorts of customization available for development. To get started you should look at Office development center.  You probably would be interested in Office Add-ins section.

    Hope this helps. 


    Slava Ivanov

    Friday, December 9, 2016 7:42 PM
  • Hi,

    on Office 365 is definitely a best practice don't touch the Master Page, if you want to customize your site I suggest to use the embed Javascript approach, there is a good solution here how to do that:

    https://github.com/SharePoint/PnP/tree/master/Samples/Core.EmbedJavaScript

    Basically you can add a javascript file to your site like a custom action, this means that for every load of any page of your site, SharePoint run your javascript file as if that is referenced in the masterpage, but with this technique you do not modify it.

    In the sample has been used a SharePoint Provider hosted app but you can do it even with a console application, thanks to CSOM.

    Kind regards


    Giuliano De Luca - MCSD SharePoint, MCSD Web Applications, MCPS, MS. www.delucagiuliano.com Twitter: @giuleon Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Friday, December 9, 2016 11:37 PM