Add a new <SCRIPT> element in the currently loaded page and set its URL.
The URL of the <SCRIPT> element.
Add a new <SCRIPT> element in the currently loaded page and set its URL.
Visual Basic |
---|
Public Sub AddScript( _ ByVal url As String _ ) |
The URL of the <SCRIPT> element.
This method can be used to insert JavaScript in a page on demand.
Private Sub mnuAddScript_Click() On Error Resume Next Dim s As String s = InputBox("Script URL:", , Replace("file:///" + App.Path + "/test.js", "\", "/")) If s = "" Then Exit Sub WebKitX1.AddScript s End Sub
private void menuItemAddScript_Click(object sender, EventArgs e) { string input = Microsoft.VisualBasic.Interaction.InputBox("Script URL", "HTML5Pad", ("file:///" + Application.CommonAppDataPath + "/test.js").Replace("\\", "/"), 500, 300); if (input != "") { WebKitXCEF31.AddScript(input); } }