On 2014/05/05 21:09:24, kalman wrote:
> this simple behaviour is generated for you. you only need the separate
> custom_bindings file if you do the registerCustomHook stuff.
Hm, would be nice, but if I only remove the according
source_map_.RegisterSource, I get the error
(BLESSED_EXTENSION context for kmdkjjdaihhnmbakbnbmljnmfcgelkcg) No source for
require(enterprise.platformKeysInternal)
Which I think is expected because the internal API is marked
"internal": true
in _api_features.json
not at google - send to devlin
2014/05/07 00:00:12
Ah right.
Yes, the problem is that you're accessi
On 2014/05/06 14:07:21, pneubeck wrote:
> On 2014/05/05 21:09:24, kalman wrote:
> > this simple behaviour is generated for you. you only need the separate
> > custom_bindings file if you do the registerCustomHook stuff.
>
> Hm, would be nice, but if I only remove the according
> source_map_.RegisterSource, I get the error
> (BLESSED_EXTENSION context for kmdkjjdaihhnmbakbnbmljnmfcgelkcg) No source
for
> require(enterprise.platformKeysInternal)
>
> Which I think is expected because the internal API is marked
> "internal": true
> in _api_features.json
Ah right.
Yes, the problem is that you're accessing chrome.platformKeysInternal and
expecting that to be generated.
Internal APIs need to be expilicitly require(..)'d, like
var platformKeysInternal = require('platformKeysInternal')
they never get entries on the chrome object, otherwise extensions can access
them.
pneubeck (no reviews)
2014/05/07 21:44:19
Internal APIs are accessed by e.g.:
var binding =
On 2014/05/07 00:00:12, kalman wrote:
> On 2014/05/06 14:07:21, pneubeck wrote:
> > On 2014/05/05 21:09:24, kalman wrote:
> > > this simple behaviour is generated for you. you only need the separate
> > > custom_bindings file if you do the registerCustomHook stuff.
> >
> > Hm, would be nice, but if I only remove the according
> > source_map_.RegisterSource, I get the error
> > (BLESSED_EXTENSION context for kmdkjjdaihhnmbakbnbmljnmfcgelkcg) No source
> for
> > require(enterprise.platformKeysInternal)
> >
> > Which I think is expected because the internal API is marked
> > "internal": true
> > in _api_features.json
>
> Ah right.
>
> Yes, the problem is that you're accessing chrome.platformKeysInternal and
> expecting that to be generated.
>
> Internal APIs need to be expilicitly require(..)'d, like
>
> var platformKeysInternal = require('platformKeysInternal')
>
> they never get entries on the chrome object, otherwise extensions can access
> them.
On 2014/05/07 21:44:19, pneubeck wrote:
> On 2014/05/07 00:00:12, kalman wrote:
> > On 2014/05/06 14:07:21, pneubeck wrote:
> > > On 2014/05/05 21:09:24, kalman wrote:
> > > > this simple behaviour is generated for you. you only need the separate
> > > > custom_bindings file if you do the registerCustomHook stuff.
> > >
> > > Hm, would be nice, but if I only remove the according
> > > source_map_.RegisterSource, I get the error
> > > (BLESSED_EXTENSION context for kmdkjjdaihhnmbakbnbmljnmfcgelkcg) No
source
> > for
> > > require(enterprise.platformKeysInternal)
> > >
> > > Which I think is expected because the internal API is marked
> > > "internal": true
> > > in _api_features.json
> >
> > Ah right.
> >
> > Yes, the problem is that you're accessing chrome.platformKeysInternal and
> > expecting that to be generated.
> >
> > Internal APIs need to be expilicitly require(..)'d, like
> >
> > var platformKeysInternal = require('platformKeysInternal')
> >
> > they never get entries on the chrome object, otherwise extensions can access
> > them.
>
> Internal APIs are accessed by e.g.:
> var binding = require('binding').Binding.create('webRequestInternal');
>
> (see
>
https://code.google.com/p/chromium/codesearch#search/&q=require%5C(.*internal...
> )
>
> the code which prevents the creation of the binding is here:
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/renderer/ex...
>
> I didn't want to generate the binding more than once, thus I put it into a
> separate module.
I see. Don't call it "custom bindings" though, it's confusing since it's not
actually a custom binding. That means a very specific thing. Perhaps an
"internal_api.js" file inside the enterprise_platform_keys directory. Loop over
the public interface to set on exports too; the 'binding' thing is also
confusing.
pneubeck (no reviews)
2014/05/08 15:04:17
Yes, that's better.
Done.
On 2014/05/08 00:13:14, kalman wrote:
> On 2014/05/07 21:44:19, pneubeck wrote:
> > On 2014/05/07 00:00:12, kalman wrote:
> > > On 2014/05/06 14:07:21, pneubeck wrote:
> > > > On 2014/05/05 21:09:24, kalman wrote:
> > > > > this simple behaviour is generated for you. you only need the separate
> > > > > custom_bindings file if you do the registerCustomHook stuff.
> > > >
> > > > Hm, would be nice, but if I only remove the according
> > > > source_map_.RegisterSource, I get the error
> > > > (BLESSED_EXTENSION context for kmdkjjdaihhnmbakbnbmljnmfcgelkcg) No
> source
> > > for
> > > > require(enterprise.platformKeysInternal)
> > > >
> > > > Which I think is expected because the internal API is marked
> > > > "internal": true
> > > > in _api_features.json
> > >
> > > Ah right.
> > >
> > > Yes, the problem is that you're accessing chrome.platformKeysInternal and
> > > expecting that to be generated.
> > >
> > > Internal APIs need to be expilicitly require(..)'d, like
> > >
> > > var platformKeysInternal = require('platformKeysInternal')
> > >
> > > they never get entries on the chrome object, otherwise extensions can
access
> > > them.
> >
> > Internal APIs are accessed by e.g.:
> > var binding = require('binding').Binding.create('webRequestInternal');
> >
> > (see
> >
>
https://code.google.com/p/chromium/codesearch#search/&q=require%5C(.*internal...
> > )
> >
> > the code which prevents the creation of the binding is here:
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/renderer/ex...
> >
> > I didn't want to generate the binding more than once, thus I put it into a
> > separate module.
>
> I see. Don't call it "custom bindings" though, it's confusing since it's not
> actually a custom binding. That means a very specific thing. Perhaps an
> "internal_api.js" file inside the enterprise_platform_keys directory. Loop
over
> the public interface to set on exports too; the 'binding' thing is also
> confusing.
Issue 214863002: Extension API enterprise.platformKeys.
(Closed)
Created 6 years, 8 months ago by pneubeck (no reviews)
Modified 6 years, 7 months ago
Reviewers: Ryan Sleevi, not at google - send to devlin, eroman, mattm, jochen (gone - plz use gerrit), Alexei Svitkine (slow)
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 209