{"action":"created","issue":{"url":"https://api.github.com/repos/electron/electron/issues/1958","repository_url":"https://api.github.com/repos/electron/electron","labels_url":"https://api.github.com/repos/electron/electron/issues/1958/labels{/name}","comments_url":"https://api.github.com/repos/electron/electron/issues/1958/comments","events_url":"https://api.github.com/repos/electron/electron/issues/1958/events","html_url":"https://github.com/electron/electron/issues/1958","id":87758246,"number":1958,"title":"<webview> preload doesn't take path relative to app folder","user":{"login":"frozeman","id":232662,"avatar_url":"https://avatars.githubusercontent.com/u/232662?v=3","gravatar_id":"","url":"https://api.github.com/users/frozeman","html_url":"https://github.com/frozeman","followers_url":"https://api.github.com/users/frozeman/followers","following_url":"https://api.github.com/users/frozeman/following{/other_user}","gists_url":"https://api.github.com/users/frozeman/gists{/gist_id}","starred_url":"https://api.github.com/users/frozeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frozeman/subscriptions","organizations_url":"https://api.github.com/users/frozeman/orgs","repos_url":"https://api.github.com/users/frozeman/repos","events_url":"https://api.github.com/users/frozeman/events{/privacy}","received_events_url":"https://api.github.com/users/frozeman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-06-12T15:15:24Z","updated_at":"2016-09-12T07:50:03Z","closed_at":"2015-06-16T02:15:48Z","body":"I if want to preload a file for a webview tag and just pass in `./myFile.js` to make it relative to the apps folder, i get the `Only \"file:\" protocol is supported in \"preload\" attribute.` error.\r\n```html\r\n<webview src=\"http://page.com\" preload=\"./myFile.js\"></webview>\r\n```\r\n\r\nIf i use the `file://` protocol i can't pass in a path which is relative to the electron app folder. I tried `file://./myFile.js` and `file://myFile.js`"},"comment":{"url":"https://api.github.com/repos/electron/electron/issues/comments/246273279","html_url":"https://github.com/electron/electron/issues/1958#issuecomment-246273279","issue_url":"https://api.github.com/repos/electron/electron/issues/1958","id":246273279,"user":{"login":"mbaer3000","id":1590320,"avatar_url":"https://avatars.githubusercontent.com/u/1590320?v=3","gravatar_id":"","url":"https://api.github.com/users/mbaer3000","html_url":"https://github.com/mbaer3000","followers_url":"https://api.github.com/users/mbaer3000/followers","following_url":"https://api.github.com/users/mbaer3000/following{/other_user}","gists_url":"https://api.github.com/users/mbaer3000/gists{/gist_id}","starred_url":"https://api.github.com/users/mbaer3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbaer3000/subscriptions","organizations_url":"https://api.github.com/users/mbaer3000/orgs","repos_url":"https://api.github.com/users/mbaer3000/repos","events_url":"https://api.github.com/users/mbaer3000/events{/privacy}","received_events_url":"https://api.github.com/users/mbaer3000/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T07:50:03Z","updated_at":"2016-09-12T07:50:03Z","body":"As for how to pass the __dirname down: attach it to the app (`electron.app.dirname = __dirname`) and then use Electron's remote to access it from the renderer app (`electron.remote.app.dirname`) and the use it in your templates or wherever you build the src attribute of the webview elements."}}
{"actor":{"display_login":"mbaer3000"}}