Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading modules in home directory via extension configuration fails, causes issues with Insiders #27

Open
disco0 opened this issue Jun 11, 2021 · 7 comments

Comments

@disco0
Copy link
Contributor

disco0 commented Jun 11, 2021

Version: 1.58.0-insider
Commit: 012b14606f75ec4fed90d7ab4154f63dffab9503
Date: 2021-06-11T05:12:17.675Z (15 hrs ago)
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Darwin x64 18.7.0

Log Screenshot

Log Content
[main 2021-06-11T20:20:30.317Z] Resolving machine identifier...
[main 2021-06-11T20:20:30.317Z] Resolved machine identifier: e4a6efdbd9e51b95219a23fd0596f5fad4a4f4fc2beb20efb752cd0ada9e50a1
[main 2021-06-11T20:20:30.318Z] Main->SharedProcess#connect
[main 2021-06-11T20:20:30.407Z] StorageMainService: creating global storage
[main 2021-06-11T20:20:30.409Z] lifecycle (main): phase changed (value: 2)
[main 2021-06-11T20:20:30.410Z] windowsManager#open
[main 2021-06-11T20:20:30.410Z] windowsManager#open pathsToOpen [ [Object: null prototype] {} ]
[main 2021-06-11T20:20:30.412Z] IPC Object URL: Registered new channel vscode:3bd64443-ca67-4558-a8a2-e2799f57c481.
[main 2021-06-11T20:20:30.413Z] window#validateWindowState: validating window state on 1 display(s) { mode: 1, x: 0, y: 23, width: 1273, height: 877 }
[main 2021-06-11T20:20:30.413Z] window#validateWindowState: 1 monitor working area { x: 0, y: 23, width: 1440, height: 877 }
[main 2021-06-11T20:20:30.413Z] window#ctor: using window state { mode: 1, x: 0, y: 23, width: 1273, height: 877 }
[main 2021-06-11T20:20:30.414Z] window: using vscode-file:// protocol and V8 cache options: bypassHeatCheck
[main 2021-06-11T20:20:30.470Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, emptyToOpen: 1)
[main 2021-06-11T20:20:30.511Z] lifecycle (main): phase changed (value: 3)
[main 2021-06-11T20:20:30.518Z] update#setState idle
[main 2021-06-11T20:20:30.518Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2021-06-11T20:20:30.753Z] resolveShellEnv(): skipped (VSCODE_CLI is set)
[main 2021-06-11T20:20:31.162Z] vscode-file: Refused to load resource /Users/disk0/dotfile/vscode/style/out/code-custom.js from vscode-file: protocol (original URL: vscode-file://vscode-app/Users/disk0/dotfile/vscode/style/out/code-custom.js)
[47382:0611/132049.431379:INFO:CONSOLE(30)] "Error: [object Event]", source: vscode-file://vscode-app/Users/disk0/Library/Application%20Support/Code%20-%20Insiders/User/globalStorage/iocave.monkey-patch/modules/browser-entrypoint.js (30)
[main 2021-06-11T20:20:49.453Z] StorageMainService: creating workspace storage (1623442848764)

Loading with exact same configuration in standard Code edition has no issues.

I can see some font size changes after enabling, so it seems customize-ui changes are possibly loading. Additionally I can't open DevTools, Process Explorer, or About page when extension is enabled—can't check how much of this is reproducing on Windows atm, going to assume its something to do with electron issues on the current macOS insiders build

Possibly Related:

@disco0
Copy link
Contributor Author

disco0 commented Jun 11, 2021

Going to assume this issue is related lol

@knopp
Copy link
Collaborator

knopp commented Jun 11, 2021

Are you using any other extensions that are using monkey-patch? The file /Users/disk0/dotfile/vscode/style/out/code-custom.js is neither from monkey-patch nor customize-ui. After update vscode can only load files from either vscode bundle or Application Support/Code - Insiders/Users/Global Storage. Any extension using customize UI should put generated javascript files inside global storage.

@disco0
Copy link
Contributor Author

disco0 commented Jun 11, 2021

Ah sorry I should've mentioned before, I'm loading this via configuration with:

    "monkeyPatch.folderMap": {
        "ui": "~/dotfile/vscode/style/out"
    },
    "monkeyPatch.mainProcessModules": [
    ],
    "monkeyPatch.browserModules": [
        "ui/code-custom"
    ],

I'll check if loading via the API works

@knopp
Copy link
Collaborator

knopp commented Jun 11, 2021

I see. It's not the API, the problem is that after latest update user script can only be loaded from "~/Library/Application Support/Code - Insiders/Users/Global Storage".

@knopp
Copy link
Collaborator

knopp commented Jun 11, 2021

You can try putting your scripts inside "~/Library/Application Support/Code - Insiders/Users/Global Storage" to see if it works.

@disco0 disco0 changed the title Patch failing to load via vscode-file protocol, resource refused Loading modules in home directory via extension configuration fails, causes issues with Insiders Jun 11, 2021
@disco0
Copy link
Contributor Author

disco0 commented Jun 12, 2021

Can confirm symlinking into GlobalStorage fixes the issue.

Not sure if you'd want to add handling or loading scripts from unsafe paths to GlobalStorage similar to how customize-ui does, but (assuming this will hit Code eventually) the readme should probably get updated with a note or have a path with GlobalStorage.

@TonioGela
Copy link

I see. It's not the API, the problem is that after latest update user script can only be loaded from "~/Library/Application Support/Code - Insiders/Users/Global Storage".

Why isn't this info written somewhere in the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants