@@ -13,8 +13,8 @@ browser.storage.local
1313//if (window.location.host == "api.mist.com") {
1414const uuid_re = / [ 0 - 9 a - f A - F ] { 8 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 12 } /
1515const uuid_re_tail = / [ 0 - 9 a - f A - F ] { 8 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 12 } $ /
16- function process_ids ( ) {
1716
17+ function process_ids ( ) {
1818 const domElements = document . getElementsByClassName ( "response-info" )
1919 var domElement , finalElements ;
2020 try {
@@ -73,21 +73,23 @@ function process_ids() {
7373 }
7474 }
7575 } catch ( e ) {
76- console . warning ( "Error in process_ids: " , e ) ;
76+ console . warn ( "Error in process_ids: " , e ) ;
7777 }
7878}
7979
8080function inject_next ( finalElements , index , host ) {
8181 const next_value = finalElements [ index ] . innerText . replaceAll ( "\"" , "" )
8282 const url = "https://" + host + next_value ;
83- finalElements [ index ] . innerHTML = "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + next_value + "</a>\"" ;
83+ let cleanHTML = DOMPurify . sanitize ( "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + next_value + "</a>\"" ) ;
84+ finalElements [ index ] . innerHTML = cleanHTML ;
8485}
8586
8687function inject_common_link ( finalElements , index , baseUrl ) {
8788 const id = get_id ( finalElements , index )
8889 const url = get_url ( baseUrl , id )
8990 if ( url && id ) {
90- finalElements [ index ] . innerHTML = "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + id + "</a>\"" ;
91+ let cleanHTML = DOMPurify . sanitize ( "\"<a href=\"" + url + "\" style=\"text-decoration: underline;color: #D14;\">" + id + "</a>\"" )
92+ finalElements [ index ] . innerHTML = cleanHTML ;
9193 }
9294 return id ;
9395}
0 commit comments