Skip to content

[FEATURE]: object Name and ProgID - naming consistency #90

@mlipok

Description

@mlipok

What feature would you like, or what problem are you facing?

using such snippet

; Get the WebView2 Manager object and register events
Local $oWeb = _NetWebView2_CreateManager("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0", _
		"", "--allow-file-access-from-files") ; 👈

__NetWebView2_ObjName_FlagsValue($oWeb)
; initialize browser - put it on the GUI
Local $sProfileDirectory = @ScriptDir & "\NetWebView2Lib-UserDataFolder"
_NetWebView2_Initialize($oWeb, $hGUI, $sProfileDirectory, 0, 0, 0, 0, True, False, False, 0.7)

; Get the bridge object and register events
Local $oBridge = _NetWebView2_GetBridge($oWeb, "__MyEVENTS_Bridge_")
__NetWebView2_ObjName_FlagsValue($oBridge)

I get:

+>	ObjName($oObj,1) {The name of the Object} =
	WebViewManager
+>	ObjName($oObj,2) {Description string of the Object} =
	

+>	ObjName($oObj,3) {The ProgID of the Object} =
	NetWebView2.Manager

and:

+>	ObjName($oObj,1) {The name of the Object} =
	WebViewBridge
+>	ObjName($oObj,2) {Description string of the Object} =
	

+>	ObjName($oObj,3) {The ProgID of the Object} =
	NetWebView2Lib.WebViewBridge

there is no consistency

What's your proposed solution?

do it consistently

+>	ObjName($oObj,1) {The name of the Object} =
	WebView2Manager
+>	ObjName($oObj,2) {Description string of the Object} =
	

+>	ObjName($oObj,3) {The ProgID of the Object} =
	NetWebView2Lib.WebView2Manager

and:

+>	ObjName($oObj,1) {The name of the Object} =
	WebView2Bridge
+>	ObjName($oObj,2) {Description string of the Object} =
	

+>	ObjName($oObj,3) {The ProgID of the Object} =
	NetWebView2Lib.WebView2Bridge

Important

Please check also other lib objects like JSON

Screenshots

No response

Do you want to work on this issue/improvement?

No

Any additional context?

Update NetWebView2Lib.au3 + ObjName($oWebV2M, $OBJ_PROGID)

Func _NetWebView2_AddInitializationScript($oWebV2M, $sScript)
	If (Not IsObj($oWebV2M)) Or ObjName($oWebV2M, $OBJ_PROGID) <> 'NetWebView2.Manager' Then Return SetError(1, 0, "ERROR: Invalid Object")

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions