Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Need API to retrieve path of current extension #929

Closed
mikechambers opened this issue May 23, 2012 · 4 comments
Closed

Need API to retrieve path of current extension #929

mikechambers opened this issue May 23, 2012 · 4 comments

Comments

@mikechambers
Copy link
Contributor

I am working on an extension where I need to dynamically load a style sheet from my extension folder into brackets.

Currently, in order to do this, you either need to hard-code the path, relative to brackets root, like so:

<link href="extensions/user/BracketsMarkdownExtension/style.css" rel="stylesheet" type="text/css" />

or get the current extension directory with the following code:

console.log(module.uri.replace("main.js", ""));

We should provide a cleaner API to get the current directory path for an extension.

@njx
Copy link

njx commented May 23, 2012

We should probably have this API anyway, but FYI the specific use case of dynamically loading extension stylesheets is on the backlog: https://trello.com/card/extension-stylesheets/4f90a6d98f77505d7940ce88/494

@mikechambers
Copy link
Contributor Author

Yep. I also need it to dynamically load HTML files into iframes.

@mikechambers
Copy link
Contributor Author

This appears to be a duplicate of #831

@mikechambers
Copy link
Contributor Author

Closing as duplicate.

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

No branches or pull requests

2 participants