I have a requirement to add a hyperlink on identity text, and I have managed to using JQuery to fulfill this under Identity page under Identity Warehouse. However, this is not working under Manage Identity > View Identity. Looks like those LCM related pages are rendered dynamically, therefore, I can not inject any html there…?
This is the JQuery I used to inject the Identity pages under Identity Warehouse, and it’s working like a charm:
if (location.pathname.endsWith('define/identity/identity.jsf')) {
let text = jQuery("#bodyDivTitle").text();
const params = new URLSearchParams(window.location.search);
let updatedInnerHtml = text + '<a href="'**** '" title="LINK">🔗</a>';
jQuery("#bodyDivTitle").html(updatedInnerHtml);
}
However, below JQuery doesnt working due to the suspected issued mentioned above:
if (location.href.includes('identities/identities.jsf#/identities')) {
let text = jQuery("#identity-name").text();
console.log(text);
let updatedInnerHtml = text + '<a href="'*****'" title="LINK">🔗</a>';
jQuery("#identity-name").html(updatedInnerHtml);
console.log(jQuery("#identity-name").html()); < HERE is undefined.
}
Any idea or suggesion on this? Potentially, we also want to inject some html under Manage User Access, but if those pages are rendered dynamically, I guess we have no chance to useing JQuery Snippets there?
Additionally, for pages under Manage User Access, MutationObserver is not enough (for whatever reason).
We will need some plugin related to windows.hashchange.
This is just experimental, as I mentioned, not so sure about this, but under Manage User Access, javascript location can not return actual full path, therefore I have to use hashchange to detect the current page. Then I can invoke corresponding MutationObserver on each page.