Skip to content

Commit

Permalink
Merge pull request #40 from gonzalo-rodriguez/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
josteink authored Nov 8, 2024
2 parents dda1330 + 9b9bede commit d58c045
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/gmailJsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
const GmailFactory = require("gmail-js");
import $ from "jquery";

const trustedHTMLpolicy = trustedTypes.createPolicy("default", {
createHTML: (to_escape) => to_escape,
});
if ("trustedTypes" in window) {
const trustedHTMLpolicy = trustedTypes.createPolicy("default", {
createHTML: (to_escape) => to_escape,
});

$.extend({
htmlPrefilter: trustedHTMLpolicy.createHTML // this is the actual function which jQuery needs
});
$.extend({
htmlPrefilter: trustedHTMLpolicy.createHTML // this is the actual function which jQuery needs
});
}

// don't mess up too bad if we have several gmail.js-based
// extensions loaded at the same time!
Expand Down

0 comments on commit d58c045

Please sign in to comment.