Skip to content

Commit

Permalink
feat: pass session key to the remote tab (#900)
Browse files Browse the repository at this point in the history
* feat: pass session key to the remote tab

* chore: typo
  • Loading branch information
nd0ut committed Feb 9, 2022
1 parent 0cb86f2 commit cf329ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ defaults = {
socialBase: 'https://social.uploadcare.com',
previewProxy: null,
previewUrlCallback: null,
remoteTabSessionKey: null,
// fine tuning
imagePreviewMaxSize: 25 * 1024 * 1024,
multipartMinSize: 10 * 1024 * 1024,
Expand Down
21 changes: 11 additions & 10 deletions src/widget/tabs/remote-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ class RemoteTab {
}

remoteUrl() {
return (
`${this.settings.socialBase}/window3/${this.name}?` +
$.param({
lang: this.settings.locale,
public_key: this.settings.publicKey,
widget_version: version,
images_only: this.settings.imagesOnly,
pass_window_open: this.settings.passWindowOpen
})
)
const params = {
lang: this.settings.locale,
public_key: this.settings.publicKey,
widget_version: version,
images_only: this.settings.imagesOnly,
pass_window_open: this.settings.passWindowOpen
}
if (this.settings.remoteTabSessionKey) {
params.session_key = this.settings.remoteTabSessionKey
}
return `${this.settings.socialBase}/window3/${this.name}?` + $.param(params)
}

__sendMessage(messageObj) {
Expand Down

0 comments on commit cf329ae

Please sign in to comment.