PageSourceSearch

https://web.movistarmusicapp.com/plugins/cordova-plugin-inappbrowser/src/browser/InAppBrowserProxy.js

js movistarmusicapp.com collected 2026-10-04 06:51:15 UTC 9,292 bytes, 245 lines download raw bytes

1cordova.define("cordova-plugin-inappbrowser.InAppBrowserProxy", function(require, exports, module) { /**
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing,
13    software distributed under the License is distributed on an
14    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15    KIND, either express or implied.  See the License for the
16    specific language governing permissions and limitations
17    under the License.
18*/
19
20const modulemapper = require('cordova/modulemapper');
21
22let browserWrap, popup, navigationButtonsDiv, navigationButtonsDivInner, backButton, forwardButton, closeButton;
23
24function attachNavigationEvents (element, callback) {
25    const onError = function () {
26        try {
27            callback({ type: 'loaderror', url: this.contentWindow.location.href }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
28        } catch (err) {
29            // blocked by CORS :\
30            callback({ type: 'loaderror', url: null }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
31        }
32    };
33
34    element.addEventListener('pageshow', function () {
35        try {
36            callback({ type: 'loadstart', url: this.contentWindow.location.href }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
37        } catch (err) {
38            // blocked by CORS :\
39            callback({ type: 'loadstart', url: null }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
40        }
41    });
42
43    element.addEventListener('load', function () {
44        try {
45            callback({ type: 'loadstop', url: this.contentWindow.location.href }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
46        } catch (err) {
47            // blocked by CORS :\
48            callback({ type: 'loadstop', url: null }, { keepCallback: true }); // eslint-disable-line n/no-callback-literal
49        }
50    });
51
52    element.addEventListener('error', onError);
53    element.addEventListener('abort', onError);
54}
55
56const IAB = {
57    close: function (win, lose) {
58        if (browserWrap) {
59            // use the "open" function callback so that the exit event is fired properly
60            if (IAB._win) IAB._win({ type: 'exit' });
61
62            browserWrap.parentNode.removeChild(browserWrap);
63            browserWrap = null;
64            popup = null;
65        }
66    },
67
68    show: function (win, lose) {
69        if (browserWrap) {
70            browserWrap.style.display = 'block';
71        }
72    },
73
74    open: function (win, lose, args) {
75        const strUrl = args[0];
76        const target = args[1];
77        const features = args[2];
78
79        IAB._win = win;
80
81        if (target === '_self' || !target) {
82            window.location = strUrl;
83        } else if (target === '_system') {
84            modulemapper.getOriginalSymbol(window, 'window.open').call(window, strUrl, '_blank');
85        } else {
86            // "_blank" or anything else
87            if (!browserWrap) {
88                browserWrap = document.createElement('div');
89                browserWrap.style.position = 'absolute';
90                browserWrap.style.top = '0';
91                browserWrap.style.left = '0';
92                browserWrap.style.boxSizing = 'border-box';
93                browserWrap.style.borderWidth = '40px';
94                browserWrap.style.width = '100vw';
95                browserWrap.style.height = '100vh';
96                browserWrap.style.borderStyle = 'solid';
97                browserWrap.style.borderColor = 'rgba(0,0,0,0.25)';
98
99                browserWrap.onclick = function () {
100                    setTimeout(function () {
101                        IAB.close();
102                    }, 0);
103                };
104
105                document.body.appendChild(browserWrap);
106            }
107
108            if (features.indexOf('hidden=yes') !== -1) {
109                browserWrap.style.display = 'none';
110            }
111
112            popup = document.createElement('iframe');
113            popup.style.borderWidth = '0px';
114            popup.style.width = '100%';
115
116            browserWrap.appendChild(popup);
117
118            if (features.indexOf('location=yes') !== -1 || features.indexOf('location') === -1) {
119                popup.style.height = 'calc(100% - 60px)';
120                popup.style.marginBottom = '-4px';
121
122                navigationButtonsDiv = document.createElement('div');
123                navigationButtonsDiv.style.height = '60px';
124                navigationButtonsDiv.style.backgroundColor = '#404040';
125                navigationButtonsDiv.style.zIndex = '999';
126                navigationButtonsDiv.onclick = function (e) {
127                    e.cancelBubble = true;
128                };
129
130                navigationButtonsDivInner = document.createElement('div');
131                navigationButtonsDivInner.style.paddingTop = '10px';
132                navigationButtonsDivInner.style.height = '50px';
133                navigationButtonsDivInner.style.width = '160px';
134                navigationButtonsDivInner.style.margin = '0 auto';
135                navigationButtonsDivInner.style.backgroundColor = '#404040';
136                navigationButtonsDivInner.style.zIndex = '999';
137                navigationButtonsDivInner.onclick = function (e) {
138                    e.cancelBubble = true;
139                };
140
141                backButton = document.createElement('button');
142                backButton.style.width = '40px';
143                backButton.style.height = '40px';
144                backButton.style.borderRadius = '40px';
145
146                backButton.innerHTML = '←';
147                backButton.addEventListener('click', function (e) {
148                    if (popup.canGoBack) {
149                        popup.goBack();
150                    }
151                });
152
153                forwardButton = document.createElement('button');
154                forwardButton.style.marginLeft = '20px';
155                forwardButton.style.width = '40px';
156                forwardButton.style.height = '40px';
157                forwardButton.style.borderRadius = '40px';
158
159                forwardButton.innerHTML = '→';
160                forwardButton.addEventListener('click', function (e) {
161                    if (popup.canGoForward) {
162                        popup.goForward();
163                    }
164                });
165
166                closeButton = document.createElement('button');
167                closeButton.style.marginLeft = '20px';
168                closeButton.style.width = '40px';
169                closeButton.style.height = '40px';
170                closeButton.style.borderRadius = '40px';
171
172                closeButton.innerHTML = '✖';
173                closeButton.addEventListener('click', function (e) {
174                    setTimeout(function () {
175                        IAB.close();
176                    }, 0);
177                });
178
179                // iframe navigation is not yet supported
180                backButton.disabled = true;
181                forwardButton.disabled = true;
182
183                navigationButtonsDivInner.appendChild(backButton);
184                navigationButtonsDivInner.appendChild(forwardButton);
185                navigationButtonsDivInner.appendChild(closeButton);
186                navigationButtonsDiv.appendChild(navigationButtonsDivInner);
187
188                browserWrap.appendChild(navigationButtonsDiv);
189            } else {
190                popup.style.height = '100%';
191            }
192
193            // start listening for navigation events
194            attachNavigationEvents(popup, win);
195
196            popup.src = strUrl;
197        }
198    },
199
200    injectScriptCode: function (win, fail, args) {
201        const code = args[0];
202        const hasCallback = args[1];
203
204        if (browserWrap && popup) {
205            try {
206                popup.contentWindow.eval(code);
207                if (hasCallback) {
208                    win([]);
209                }
210            } catch (e) {
211                console.error('Error occured while trying to injectScriptCode: ' + JSON.stringify(e));
212            }
213        }
214    },
215
216    injectScriptFile: function (win, fail, args) {
217        const msg = 'Browser cordova-plugin-inappbrowser injectScriptFile is not yet implemented';
218        console.warn(msg);
219        if (fail) {
220            fail(msg);
221        }
222    },
223
224    injectStyleCode: function (win, fail, args) {
225        const msg = 'Browser cordova-plugin-inappbrowser injectStyleCode is not yet implemented';
226        console.warn(msg);
227        if (fail) {
228            fail(msg);
229        }
230    },
231
232    injectStyleFile: function (win, fail, args) {
233        const msg = 'Browser cordova-plugin-inappbrowser injectStyleFile is not yet implemented';
234        console.warn(msg);
235        if (fail) {
236            fail(msg);
237        }
238    }
239};
240
241module.exports = IAB;
242
243require('cordova/exec/proxy').add('InAppBrowser', module.exports);
244
vendor: 4 bytes, line 245
245});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.