{"action":"created","issue":{"url":"https://api.github.com/repos/mdn/webextensions-examples/issues/152","repository_url":"https://api.github.com/repos/mdn/webextensions-examples","labels_url":"https://api.github.com/repos/mdn/webextensions-examples/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/mdn/webextensions-examples/issues/152/comments","events_url":"https://api.github.com/repos/mdn/webextensions-examples/issues/152/events","html_url":"https://github.com/mdn/webextensions-examples/issues/152","id":194174835,"number":152,"title":"open-my-page-button/background.js uses chrome.extension.getURL","user":{"login":"Leif-W","id":979392,"avatar_url":"https://avatars.githubusercontent.com/u/979392?v=3","gravatar_id":"","url":"https://api.github.com/users/Leif-W","html_url":"https://github.com/Leif-W","followers_url":"https://api.github.com/users/Leif-W/followers","following_url":"https://api.github.com/users/Leif-W/following{/other_user}","gists_url":"https://api.github.com/users/Leif-W/gists{/gist_id}","starred_url":"https://api.github.com/users/Leif-W/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leif-W/subscriptions","organizations_url":"https://api.github.com/users/Leif-W/orgs","repos_url":"https://api.github.com/users/Leif-W/repos","events_url":"https://api.github.com/users/Leif-W/events{/privacy}","received_events_url":"https://api.github.com/users/Leif-W/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-07T21:27:36Z","updated_at":"2016-12-12T17:22:32Z","closed_at":"2016-12-12T17:22:32Z","body":"File: webextensions-examples/open-my-page-button/background.js\r\nFunction: openMyPage\r\nProblem: Uses chrome.extension.getURL, which creates 2 issues.\r\n\r\nFirst, I think the proper name in the API is [browser.extension.getURL](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/extension/getURL).  However, this could also be done with [browser.runtime.getURL](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/getURL).\r\n\r\nSecond, this function call may be superfluous, as browser.tabs.create will accept a string for the 'url' parameter, in which case it will (presumably and implicitly) call a similar function internally, and generate a moz-extension://GUID/relative/path.html .\r\n\r\n```\r\n\tbrowser.tabs.create( {\r\n\t\t'url': 'relative/path.html'\r\n\t} );\r\n```\r\n\r\nFrom [browser.tabs.create](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create) :\r\n\r\n> url  Optional\r\n>     string. The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.\r\n\r\nNot sure what the \"current page within the extension\" refers to.  This documentation is ambiguous.  Can the relative position change?  Most of these type of functions seem to be anchored off the location of the manifest.json.  Is this method unreliable?  Should one of the getURL methods above be used?  The getURL methods seem to be the same interface shared between two objects in the API."},"comment":{"url":"https://api.github.com/repos/mdn/webextensions-examples/issues/comments/266493098","html_url":"https://github.com/mdn/webextensions-examples/issues/152#issuecomment-266493098","issue_url":"https://api.github.com/repos/mdn/webextensions-examples/issues/152","id":266493098,"user":{"login":"wbamberg","id":432915,"avatar_url":"https://avatars.githubusercontent.com/u/432915?v=3","gravatar_id":"","url":"https://api.github.com/users/wbamberg","html_url":"https://github.com/wbamberg","followers_url":"https://api.github.com/users/wbamberg/followers","following_url":"https://api.github.com/users/wbamberg/following{/other_user}","gists_url":"https://api.github.com/users/wbamberg/gists{/gist_id}","starred_url":"https://api.github.com/users/wbamberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbamberg/subscriptions","organizations_url":"https://api.github.com/users/wbamberg/orgs","repos_url":"https://api.github.com/users/wbamberg/repos","events_url":"https://api.github.com/users/wbamberg/events{/privacy}","received_events_url":"https://api.github.com/users/wbamberg/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T17:22:32Z","updated_at":"2016-12-12T17:22:32Z","body":"> Also, perhaps the documentation could mention the absolute path starting with manifest.json:\r\n\r\nYes, this is done: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create#Parameters. There are definitely other places where the same advice applies, but I think it's OK to duplicate it.\r\n\r\nThanks for raising the issue. This is definitely a non-obvious and potentially frustrating thing, that needed to be noted."}}
{"actor":{"display_login":"wbamberg"}}