Comments (7)
Map supports case sensitivity, while object is not case sensitive, although it is rare to have keys with different cases at the same time.
And run Map.Prototype.DefineProp('__get', {call: Map.Prototype.Get})
, you can use map just like object.
from ahk2_lib.
Interesting trick, thanks a lot.
Strange how it stays case sensitive, or you need to set the CaseSense Off before filling the object. in some strange cases you would indeed lose data and that is indeed a disadvantage to this approach, and maybe it is better to keep the code cleaner.
oMap := Map()
oMap.CaseSense := "Off"
oMap.Set("Red", "ff0000" , "Green", "00ff00", "Deep Blue", "0000ff")
oMap.DefineProp('__get', { call: oMap.Get })
MsgBox("oMap.red:" oMap.red "`noMap.Red:" oMap.Red)
from ahk2_lib.
I however have another question, I want to connect to chrome without opening a new tab, but it seems this version always opens a new tab.
If I remember correctly, I used to connect to Chrome with:
PageInst := Chrome.GetPage()
But I now get the error "This value of type ''Class" has no method named "GetPage".
This code seems to work, but always opens a new tab:
ChromeInst := Chrome()
ChromeTab := ChromeInst.GetPage()
from ahk2_lib.
Use an existing browser that starts in debug mode?
from ahk2_lib.
Yes, I have the habit to run my browser always in debug mode. In the V1 version you could connect to the existing debug window with this code.
from ahk2_lib.
This problem has been fixed. Chrome.FindInstances
from ahk2_lib.
Tested and approved.
Just for clarity, my previous code still does not work.
this seems to work perfectly:
ChromeInst := Chrome.FindInstances()
ChromeTab := ChromeInst.GetPage()
result := ChromeTab.Evaluate("window.location.href")
msgbox(result["value"])
from ahk2_lib.
Related Issues (20)
- Issue at '__Delete' in RapidOcr lib
- [child_process.ahk] Strange line wrapping bug HOT 12
- RapidOcr在新装的Win10企业版上,未安装“微软VC++运行库合集”无法加载dll文件 HOT 1
- Chrome.ahk not compatible with latest Websocket.ahk HOT 1
- WebSocket.ahk: Error: Malformed _JSON - unrecognized character-
- [Webview2] Add example for bypassing CORS? HOT 4
- Why aren't my headers being set? HOT 3
- [WebView2] Examples for working with cookies. HOT 3
- [WebView2.ahk] In some rare cases WebView2.create(placeholder.Hwnd) returns 0 HOT 2
- JSON库无法正确解析四个连续的反斜杠
- [WebView2] New version of library gives error when compiled HOT 2
- stuck on wait for response HOT 5
- Native 不适用 AutoHotkey.dll HOT 1
- Is the cpp JSON parser officially part of ahk_lib? HOT 2
- unsuccessful attempt to upgrade Native.ahk
- [Crypt.ahk] Is this lib unfinished? HOT 7
- WebView2 support local files? HOT 1
- After compile to Exe, LoadScript does not work. HOT 3
- Using WebView2 to open local html-page HOT 1
- RapidOcrOnnx.dll GPU support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahk2_lib.