Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm sorry to say but this problem as posed by you is in essence unsolvable because of one simple problem: <strong>You can't trust the client.</strong> And since the client can see the code then you can't solve the problem.</p> <p>Any information coming from the client side can be replicated by other means. It is essentially the same problem as trying to prove that when a user logs into their account it is actually the user not somebody else who found out or was given their username and password.</p> <p>The internet security models are built around 2 parties trying to communicate without a third party being able to imitate one, modify or listen the conversation. Without hiding the source code of the extension the client becomes indistinguishable from the third party (A file among copies - no way to determine which is which).</p> <p>If the source code is hidden it becomes a whole other story. Now the user or malicious party doesn't have access to the secrets the real client knows and all the regular security models apply. However it is doubtful that Chrome will allow hidden source code in extensions, because it would produce other security issues. </p> <p>Some source code can be hidden using NPAPI Plugins as you stated, but it comes with a price as you already know.</p> <hr> <p>Coming back to the current state of things:</p> <p>Now it becomes a question of what is meant by interaction.</p> <p>If interaction means that while the user is on the page you want to know if it is your extension or some other then the closest you can get is to list your page in the extensions manifest under <em>app</em> section as documented <a href="https://developers.google.com/chrome/apps/docs/developers_guide#manifest" rel="nofollow">here</a></p> <p>This will allow you to ask on the page if the app is installed by using </p> <pre><code> chrome.app.isInstalled </code></pre> <p>This will return boolean showing wether your app is installed or not. The command is documented <a href="https://developers.google.com/chrome/web-store/docs/inline_installation#already-installed" rel="nofollow">here</a></p> <p>However this does not really solve the problem, since the extension may be installed, but not enabled and there is another extension mocking the communication with your site.</p> <p>Furthermore the validation is on the client side so any function that uses that validation can be overwritten to ignore the result of this variable.</p> <p>If however the interaction means making XMLHttpRequests then you are out of luck. Can't be done using current methods because of the visibility of source code as discussed above.</p> <p>However if it is <strong>limiting your sites usability to authorized entities</strong> I suggest using regular means of authentication: having the user log in will allow you to create a session. This session will be propagated to all requests made by the extension so you are down to regular client log in trust issues like account sharing etc. These can of course be managed by making the user log in say via their Google account, which most are reluctant to share and further mitigated by blocking accounts that seem to be misused.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload