Add deprecation warnings fot html/rtf methods (#11995)
This commit is contained in:
parent
f7ec346e9f
commit
0ef8f1bdad
1 changed files with 33 additions and 0 deletions
|
@ -2,8 +2,41 @@ if (process.platform === 'linux' && process.type === 'renderer') {
|
||||||
// On Linux we could not access clipboard in renderer process.
|
// On Linux we could not access clipboard in renderer process.
|
||||||
module.exports = require('electron').remote.clipboard
|
module.exports = require('electron').remote.clipboard
|
||||||
} else {
|
} else {
|
||||||
|
const {deprecate} = require('electron')
|
||||||
const clipboard = process.atomBinding('clipboard')
|
const clipboard = process.atomBinding('clipboard')
|
||||||
|
|
||||||
|
// TODO(codebytere): remove in 3.0
|
||||||
|
clipboard.readHtml = function () {
|
||||||
|
if (!process.noDeprecations) {
|
||||||
|
deprecate.warn('clipboard.readHtml', 'clipboard.readHTML')
|
||||||
|
}
|
||||||
|
return clipboard.readHTML()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(codebytere): remove in 3.0
|
||||||
|
clipboard.writeHtml = function () {
|
||||||
|
if (!process.noDeprecations) {
|
||||||
|
deprecate.warn('clipboard.writeHtml', 'clipboard.writeHTML')
|
||||||
|
}
|
||||||
|
return clipboard.writeHTML()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(codebytere): remove in 3.0
|
||||||
|
clipboard.readRtf = function () {
|
||||||
|
if (!process.noDeprecations) {
|
||||||
|
deprecate.warn('clipboard.readRtf', 'clipboard.writeRTF')
|
||||||
|
}
|
||||||
|
return clipboard.readRTF()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(codebytere): remove in 3.0
|
||||||
|
clipboard.writeRtf = function () {
|
||||||
|
if (!process.noDeprecations) {
|
||||||
|
deprecate.warn('clipboard.writeRtf', 'clipboard.writeRTF')
|
||||||
|
}
|
||||||
|
return clipboard.writeRTF()
|
||||||
|
}
|
||||||
|
|
||||||
// Read/write to find pasteboard over IPC since only main process is notified
|
// Read/write to find pasteboard over IPC since only main process is notified
|
||||||
// of changes
|
// of changes
|
||||||
if (process.platform === 'darwin' && process.type === 'renderer') {
|
if (process.platform === 'darwin' && process.type === 'renderer') {
|
||||||
|
|
Loading…
Reference in a new issue