Skip to content

Commit

Permalink
fix: merge from main.
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed Sep 2, 2022
2 parents 55eb77f + cabf605 commit b1814e1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
# npx lint-staged
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"highlight.js": "^11.3.1",
"ini": "^2.0.0",
"js-base64": "^3.7.2",
"json5": "^2.2.0",
"json5": "^2.2.1",
"jszip": "^3.7.1",
"lodash.omit": "^4.5.0",
"marked": "^4.0.8",
Expand Down
30 changes: 19 additions & 11 deletions src/monkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,25 @@ try {
hookIntoHyperGraph: settings.isFeatureEnabled('hookIntoHyperGraph')
}

/*
TODO: MV3 Unfixed
const inlineConfigScriptTag = scope.document.createElement('script')
inlineConfigScriptTag.innerHTML = 'window.demoMonkeyConfig = ' + JSON.stringify(inlineConfig)
scope.document.head.append(inlineConfigScriptTag)
*/

const inlineScriptTag = scope.document.createElement('script')
inlineScriptTag.setAttribute('id', 'demo-monkey-inline-script')
inlineScriptTag.src = scope.chrome.runtime.getURL('js/inline.js')
scope.document.head.append(inlineScriptTag)


if (inlineConfig.hookIntoAjax || inlineConfig.hookIntoHyperGraph) {
if (!['miro.com'].includes(scope.location.host)) {
/*
TODO: MV3 Unfixed
const inlineConfigScriptTag = scope.document.createElement('script')
inlineConfigScriptTag.innerHTML = 'window.demoMonkeyConfig = ' + JSON.stringify(inlineConfig)
scope.document.head.append(inlineConfigScriptTag)
*/

const inlineScriptTag = scope.document.createElement('script')
inlineScriptTag.setAttribute('id', 'demo-monkey-inline-script')
inlineScriptTag.src = scope.chrome.extension.getURL('js/inline.js')
scope.document.head.append(inlineScriptTag)
} else {
logger('warn', `inline.js not loaded, because ${scope.location.host} may break, see https://github.com/svrnm/DemoMonkey/issues/21`).write()
}
}

// We don't use the redux store, since below we restart demo monkey
// every time the store is updated, which would lead to a loop.
Expand Down

0 comments on commit b1814e1

Please sign in to comment.