pinokiod 3.110.0 → 3.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.110.0",
3
+ "version": "3.111.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5012,6 +5012,13 @@ body.dark {
5012
5012
 
5013
5013
  let target = explicitTarget
5014
5014
  let preselected = null
5015
+ let defaultSelectionNode = null
5016
+ const getDefaultSelection = () => {
5017
+ if (defaultSelectionNode === null) {
5018
+ defaultSelectionNode = document.querySelector('[data-default]')
5019
+ }
5020
+ return defaultSelectionNode
5021
+ }
5015
5022
 
5016
5023
  if (!target && eventParam) {
5017
5024
  target = eventParam.target?.closest(".frame-link") || null
@@ -5053,13 +5060,18 @@ body.dark {
5053
5060
 
5054
5061
  const devTab = document.querySelector('#devtab.frame-link')
5055
5062
  if (!triggeredByUser && !resolvedByGlobalSelector && !target && devRouteActive && devTab) {
5056
- target = devTab
5057
- } else if (!target && preselected) {
5063
+ const defaultCandidate = getDefaultSelection()
5064
+ if (!(pluginLaunchActive && defaultCandidate)) {
5065
+ target = devTab
5066
+ }
5067
+ }
5068
+
5069
+ if (!target && preselected) {
5058
5070
  target = preselected
5059
5071
  }
5060
5072
 
5061
5073
  if (!target) {
5062
- const defaultSelection = document.querySelector("[data-default]")
5074
+ const defaultSelection = getDefaultSelection()
5063
5075
  if (defaultSelection) {
5064
5076
  target = defaultSelection
5065
5077
  } else if (skipPersistedSelection) {
@@ -5070,7 +5082,7 @@ body.dark {
5070
5082
 
5071
5083
  <% if (type === "run" && env.PINOKIO_SCRIPT_DEFAULT && env.PINOKIO_SCRIPT_DEFAULT.toString().toLowerCase() === "true") { %>
5072
5084
  if (!target && !hasPersistedSelection) {
5073
- const defaultSelection = document.querySelector("[data-default]")
5085
+ const defaultSelection = getDefaultSelection()
5074
5086
  if (defaultSelection && defaultSelection.href) {
5075
5087
  const selectionProtocol = new URL(defaultSelection.href).protocol
5076
5088
  const pageProtocol = new URL(location.href).protocol