Restore Revision Time Visual Text in Google Apps

Brings back visual last edit text in drive apps due to M3 migration by Google.

< 腳本Restore Revision Time Visual Text in Google Apps的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2024-01-02

Useful script! Worked for awhile but broke because Google changed their CSP. Luckily it is simple to fix. Add this at the top of the function:

const escapeHTMLPolicy = trustedTypes.createPolicy("default", {
    createHTML: (string) => string,
});

Then tweak the two lines that set use HTML strings to use the sanitization function as follows:

const fragmentForRevisionVisualTextHTML = rangeForRevisionVisualTextHTML.createContextualFragment(escapeHTMLPolicy.createHTML(revisionVisualTextHTML));
revisionVisualTextElement.innerHTML = escapeHTMLPolicy.createHTML(revisionTextFromButton);
zachthedev作者
§
發表於:2024-01-02

Thanks! I just posted the update.

發表回覆

登入以回覆

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址