Notes
Notes - notes.io |
Dim jss3 As String = "
var elements = document.querySelectorAll('div.message-bubble');
elements.forEach(function(el){
el.remove();
});
"
' Execute it asynchronously in WebView2
Await WebView28.ExecuteScriptAsync(jss3)
If PictureBox1.Image Is Nothing Then
MessageBox.Show("No image in PictureBox")
Return
End If
' Convert PictureBox image to Base64 PNG
Dim ms As New MemoryStream()
PictureBox1.Image.Save(ms, ImageFormat.Png)
Dim imageBytes() As Byte = ms.ToArray()
Dim base64String As String = Convert.ToBase64String(imageBytes)
' Escape Base64 for JS
Dim jsBase64 As String = base64String.Replace("+", "%2B").Replace("/", "%2F").Replace("=", "%3D")
' JavaScript: create a Blob from Base64 and dispatch paste
Dim js As String = $"
(function() {{
function base64ToBlob(base64, type) {{
const binary = atob(base64);
const array = [];
for (let i = 0; i < binary.length; i++) {{
array.push(binary.charCodeAt(i));
}}
return new Blob([new Uint8Array(array)], {{ type: type }});
}}
var editorDiv = document.querySelector('div[contenteditable=""true""]');
if(!editorDiv) return;
var blob = base64ToBlob('{base64String}', 'image/png');
var file = new File([blob], 'image.png', {{ type: 'image/png' }});
var clipboardData = new DataTransfer();
clipboardData.items.add(file);
var pasteEvent = new ClipboardEvent('paste', {{ clipboardData: clipboardData }});
editorDiv.dispatchEvent(pasteEvent);
}})();
"
' Execute JS in WebView2
Await WebView28.ExecuteScriptAsync(js)
Await Task.Delay(10000)
' This JavaScript removes all divs that contain class "message-bubble"
Dim jss As String = "
var elements = document.querySelectorAll('div.message-bubble');
elements.forEach(function(el){
el.remove();
});
"
' Execute it asynchronously in WebView2
Await WebView28.ExecuteScriptAsync(jss)
Await Task.Delay(5000)
Dim number As Double = ComboBox1.SelectedItem.ToString
Dim result421 As Integer = CInt(Math.Round(number / 6))
Dim textToInsert As String = "Write new scenes please, still have the same niche. Write scenes of restorations for this house. In the end this house must look same color and stuff but fully restored. Now we need " & result421 & " of parts."
' Escape the string for JavaScript (replace backslashes and quotes)
textToInsert = textToInsert.Replace("", "\").Replace("'", "'").Replace(vbCrLf, "<br>")
' Build JavaScript code to insert into the contenteditable div
Dim jsCode As String = $"
var editor = document.querySelector('div[contenteditable=""true""]');
if(editor) {{
editor.innerHTML = '<p>{textToInsert}</p>';
editor.dispatchEvent(new Event('input', {{ bubbles: true }}));
}}
"
' Execute the JS code in WebView2
Await WebView28.ExecuteScriptAsync(jsCode)
Await Task.Delay(3000)
' JavaScript to find and click the button
Dim jsClickButton As String = "
var btn = document.querySelector('button[aria-label=""Submit""]');
if(btn) {
btn.click();
}
"
' Execute the JavaScript in WebView2
Await WebView28.ExecuteScriptAsync(jsClickButton)
Dim jss4 As String = "
var elements = document.querySelectorAll('div.message-bubble');
elements.forEach(function(el){
el.remove();
});
"
' Execute it asynchronously in WebView2
Await WebView28.ExecuteScriptAsync(jss4)
Await Task.Delay(3000)
Timer12.Start()
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
