2024年3月5日 星期二

web content element filter +headings +TAGS +firefox +extension

 for (var i = 0, headings = $$('h1,h2,h3,h4,h5,h6'); i < headings.length; i++) {
console.log(headings[i].textContent.trim() + " " + headings[i].tagName, headings[i]);
}

for (var i = 0, headings = $$('h1,h2,h3,h4,h5,h6'); i < headings.length; i++) {
console.log( headings[i]);
}

var str1 = "";
for (var i = 0, headings = $$('h3'); i < headings.length; i++) {
console.log(headings[i].textContent.trim() );
str1 =str1 +"<a>"+ headings[i].textContent.trim() +"</a><br />" ;
}
console.log(str1);


 $$('h3')[2].textContent.trim()

https://firefox-source-docs.mozilla.org/devtools-user/browser_console/index.html
https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/console/console-filters
https://developer.mozilla.org/en-US/docs/Web/API

https://bugzilla.mozilla.org/show_bug.cgi?id=1509768
https://bugzilla.mozilla.org/attachment.cgi?id=9027436&action=diff

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat

console.log(
  "N"+"a".repeat(23).replace('a', 'b').replace("", "foo")
);


var str1 = '$-920455.00',str2;
str2 = str1.slice(2);
//str2 = str1.replace(/^.{2}/g, 'rr');
alert(str1 +'~~~'+str2);


//JS STRING  remove RegExp  /[0-9]/g   <ol> <li>
var value = "123gfr/54ee..21123.456adc";
value = value.replace(/[\^@\.\/\d]/g,'');
// ^@ . / 0-9\d
//gfreeadc

沒有留言: