Compare commits

..

2 commits

Author SHA1 Message Date
fdad635b10 fix: remove propagateComposedEvents and fix plugin author (#50, #51)
- TailscaleWidget.qml: remove propagateComposedEvents from right-click MouseArea
- plugin.json: clean up author string
2026-05-21 10:13:22 +00:00
299a2dcf85 fix: lib.js security and correctness fixes (#40, #41)
- parsePeers: add hasOwnProperty guard and filter null entries
- findActiveExitNode: add hasOwnProperty guard to for..in loop
- makeExitNodeCommand: handle empty hostname correctly
2026-05-21 10:11:03 +00:00
3 changed files with 7 additions and 7 deletions

View file

@ -321,14 +321,9 @@ PluginComponent {
}
}
// propagateComposedEvents: true so that right-clicks both trigger our context menu
// *and* bubble to any parent MouseArea (e.g. for shell-level drag handling).
// Documented because the default (false) is far more common and this choice
// frequently surprises future maintainers.
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
propagateComposedEvents: true
onClicked: {
root.toggleTailscale()
}

View file

@ -1,6 +1,7 @@
function parsePeers(peerMap) {
if (!peerMap) return []
return Object.keys(peerMap).map(function (key) {
if (!Object.prototype.hasOwnProperty.call(peerMap, key)) return null
var p = peerMap[key]
return {
hostname: p.HostName || key,
@ -8,16 +9,20 @@ function parsePeers(peerMap) {
online: p.Online || false,
exitNode: p.ExitNodeOption || false
}
})
}).filter(function (peer) { return peer !== null })
}
function makeExitNodeCommand(hostname) {
if (hostname === "") {
return ["tailscale", "set", "--exit-node="]
}
return ["tailscale", "set", "--exit-node=" + hostname]
}
function findActiveExitNode(peerMap) {
if (!peerMap) return ""
for (const key in peerMap) {
if (!Object.prototype.hasOwnProperty.call(peerMap, key)) continue
const p = peerMap[key]
if (p.ExitNode) {
return p.HostName || key

View file

@ -3,7 +3,7 @@
"name": "Tailscale",
"description": "Tailscale status and controls on the Dank Bar",
"version": "0.1.0",
"author": "John Morris & Vybe (AI Slop... er... Coding Assistant)",
"author": "John Morris",
"icon": "vpn_key",
"type": "widget",
"component": "./TailscaleWidget.qml",