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

Plugins stored in userData directory can't access static resources #1135

Closed
barmac opened this issue Jan 23, 2019 · 2 comments · Fixed by #1137
Closed

Plugins stored in userData directory can't access static resources #1135

barmac opened this issue Jan 23, 2019 · 2 comments · Fixed by #1137
Assignees
Labels
bug Something isn't working plugins
Milestone

Comments

@barmac
Copy link
Collaborator

barmac commented Jan 23, 2019

Describe the Bug

Failed to load resource: net::ERR_FILE_NOT_FOUND error thrown even though logo is in the plugin directory.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a plugin from https://github.com/camunda/camunda-modeler-plugins
  2. Drop plug-in into ${userData}/plugins
  3. Open BPMN editor
  4. Check console

Expected Behavior

No error and image attached.

Environment

Please complete the following information:

  • OS: Any
  • Camunda Modeler Version: 2.2.4, 3.0.0-0

Solution Approach

Based on this comment, the following sketches the solution to this problem:

  • Let plug-ins load resources via custom protocol, i.e. foobar://${pluginName}/${nameOfResource}
  • Intercept loading of these resources via webrequest filter, figure out actual plugin folder and redirect to the appropriate file://... url
@barmac barmac added bug Something isn't working plugins labels Jan 23, 2019
@barmac
Copy link
Collaborator Author

barmac commented Jan 23, 2019

Notes:

We force the plugins to use the exe directory if they don't inline the directory: https://github.com/camunda/camunda-modeler/blob/master/app/lib/index.js#L57

Consider adding custom protocol for the plugins to access plugin directory. Use https://electronjs.org/docs/api/web-request for that.

Related camunda/camunda-modeler-plugins#12

@nikku

@barmac barmac added ready Ready to be worked on needs discussion Needs further discussion and removed ready Ready to be worked on needs discussion Needs further discussion labels Jan 23, 2019
@nikku nikku changed the title Plugins can't access static resources on MacOS Plugins stored in userData directory can't access static resources Jan 23, 2019
@nikku
Copy link
Member

nikku commented Jan 23, 2019

Affects any OS, as long as the plug-in is stored in the userData directory (the only way to store plug-ins on MacOS; no workaround exists on that platform). I updated the issue accordingly.

@nikku nikku added the ready Ready to be worked on label Jan 23, 2019
@nikku nikku added this to the M27 milestone Jan 23, 2019
nikku added a commit that referenced this issue Jan 23, 2019
Resolve plug-in assets requested via a logical name

  app-plugins://${name}${assetPath}

using the appropriate actual plug-in base.

Closes #1135
@ghost ghost assigned nikku Jan 23, 2019
@ghost ghost added in progress Currently worked on and removed ready Ready to be worked on labels Jan 23, 2019
nikku added a commit that referenced this issue Jan 23, 2019
Resolve plug-in assets requested via a logical name

  app-plugins://${name}${assetPath}

using the appropriate actual plug-in base.

Closes #1135
@ghost ghost added needs review Review pending and removed in progress Currently worked on labels Jan 23, 2019
nikku added a commit that referenced this issue Jan 23, 2019
Resolve plug-in assets requested via a logical name

  app-plugins://${name}${assetPath}

using the appropriate actual plug-in base.

Closes #1135
barmac pushed a commit that referenced this issue Jan 24, 2019
Resolve plug-in assets requested via a logical name

  app-plugins://${name}${assetPath}

using the appropriate actual plug-in base.

Closes #1135
barmac pushed a commit that referenced this issue Jan 24, 2019
Resolve plug-in assets requested via a logical name

  app-plugins://${name}${assetPath}

using the appropriate actual plug-in base.

Closes #1135
@ghost ghost removed the needs review Review pending label Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants