diff --git a/atom/atom_cef_app.mm b/atom/atom_cef_app.mm index 87019c2b6..02868b369 100644 --- a/atom/atom_cef_app.mm +++ b/atom/atom_cef_app.mm @@ -9,6 +9,10 @@ void AtomCefApp::OnWebKitInitialized() { void AtomCefApp::OnContextCreated(CefRefPtr browser, CefRefPtr frame, - CefRefPtr context) { - NSLog(@"%s", "OnContextCreated"); + CefRefPtr context) { + CefRefPtr global = context->GetGlobal(); + CefRefPtr atom = CefV8Value::CreateObject(NULL); + CefRefPtr resourcePath = CefV8Value::CreateString([[[NSBundle mainBundle] resourcePath] UTF8String]); + atom->SetValue("resourcePath", resourcePath, V8_PROPERTY_ATTRIBUTE_NONE); + global->SetValue("atom", atom, V8_PROPERTY_ATTRIBUTE_NONE); } diff --git a/src/stdlib/require.coffee b/src/stdlib/require.coffee index aea78d3a8..5de1c8af0 100644 --- a/src/stdlib/require.coffee +++ b/src/stdlib/require.coffee @@ -1,15 +1,15 @@ paths = [ - "#{atom.loadPath}/spec" - "#{atom.loadPath}/benchmark" - "#{atom.loadPath}/src/stdlib" - "#{atom.loadPath}/src/app" - "#{atom.loadPath}/src/extensions" - "#{atom.loadPath}/src" - "#{atom.loadPath}/vendor" - "#{atom.loadPath}/static" - "#{atom.loadPath}/bundles" - "#{atom.loadPath}/themes" - "#{atom.loadPath}" + "#{atom.resourcePath}/spec" + "#{atom.resourcePath}/benchmark" + "#{atom.resourcePath}/src/stdlib" + "#{atom.resourcePath}/src/app" + "#{atom.resourcePath}/src/extensions" + "#{atom.resourcePath}/src" + "#{atom.resourcePath}/vendor" + "#{atom.resourcePath}/static" + "#{atom.resourcePath}/bundles" + "#{atom.resourcePath}/themes" + "#{atom.resourcePath}" ] window.__filename = null