mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Replaces all preprocessor directives with PDFJSDev calls.
This commit is contained in:
parent
bf52ff156d
commit
0576c9c6c6
32 changed files with 1145 additions and 904 deletions
|
@ -12,6 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals chrome */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -191,30 +192,30 @@
|
|||
|
||||
_pushOrReplaceState: function pdfHistory_pushOrReplaceState(stateObj,
|
||||
replace) {
|
||||
//#if CHROME
|
||||
// history.state.chromecomState is managed by chromecom.js.
|
||||
if (window.history.state && 'chromecomState' in window.history.state) {
|
||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
|
||||
window.history.state && 'chromecomState' in window.history.state) {
|
||||
stateObj = stateObj || {};
|
||||
stateObj.chromecomState = window.history.state.chromecomState;
|
||||
}
|
||||
//#endif
|
||||
if (replace) {
|
||||
//#if (GENERIC || CHROME)
|
||||
window.history.replaceState(stateObj, '', document.URL);
|
||||
//#else
|
||||
// window.history.replaceState(stateObj, '');
|
||||
//#endif
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
PDFJSDev.test('GENERIC || CHROME')) {
|
||||
window.history.replaceState(stateObj, '', document.URL);
|
||||
} else {
|
||||
window.history.replaceState(stateObj, '');
|
||||
}
|
||||
} else {
|
||||
//#if (GENERIC || CHROME)
|
||||
window.history.pushState(stateObj, '', document.URL);
|
||||
//#else
|
||||
// window.history.pushState(stateObj, '');
|
||||
//#endif
|
||||
//#if CHROME
|
||||
// if (top === window) {
|
||||
// chrome.runtime.sendMessage('showPageAction');
|
||||
// }
|
||||
//#endif
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
PDFJSDev.test('GENERIC || CHROME')) {
|
||||
window.history.pushState(stateObj, '', document.URL);
|
||||
} else {
|
||||
window.history.pushState(stateObj, '');
|
||||
}
|
||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME') &&
|
||||
top === window) {
|
||||
chrome.runtime.sendMessage('showPageAction');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue